android_kernel_xiaomi_sm8350/include/asm-ia64
Nick Piggin 7e675137a8 mm: introduce pte_special pte bit
s390 for one, cannot implement VM_MIXEDMAP with pfn_valid, due to their memory
model (which is more dynamic than most).  Instead, they had proposed to
implement it with an additional path through vm_normal_page(), using a bit in
the pte to determine whether or not the page should be refcounted:

vm_normal_page()
{
	...
        if (unlikely(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))) {
                if (vma->vm_flags & VM_MIXEDMAP) {
#ifdef s390
			if (!mixedmap_refcount_pte(pte))
				return NULL;
#else
                        if (!pfn_valid(pfn))
                                return NULL;
#endif
                        goto out;
                }
	...
}

This is fine, however if we are allowed to use a bit in the pte to determine
refcountedness, we can use that to _completely_ replace all the vma based
schemes.  So instead of adding more cases to the already complex vma-based
scheme, we can have a clearly seperate and simple pte-based scheme (and get
slightly better code generation in the process):

vm_normal_page()
{
#ifdef s390
	if (!mixedmap_refcount_pte(pte))
		return NULL;
	return pte_page(pte);
#else
	...
#endif
}

And finally, we may rather make this concept usable by any architecture rather
than making it s390 only, so implement a new type of pte state for this.
Unfortunately the old vma based code must stay, because some architectures may
not be able to spare pte bits.  This makes vm_normal_page a little bit more
ugly than we would like, but the 2 cases are clearly seperate.

So introduce a pte_special pte state, and use it in mm/memory.c.  It is
currently a noop for all architectures, so this doesn't actually result in any
compiled code changes to mm/memory.o.

BTW:
I haven't put vm_normal_page() into arch code as-per an earlier suggestion.
The reason is that, regardless of where vm_normal_page is actually
implemented, the *abstraction* is still exactly the same. Also, while it
depends on whether the architecture has pte_special or not, that is the
only two possible cases, and it really isn't an arch specific function --
the role of the arch code should be to provide primitive functions and
accessors with which to build the core code; pte_special does that. We do
not want architectures to know or care about vm_normal_page itself, and
we definitely don't want them being able to invent something new there
out of sight of mm/ code. If we made vm_normal_page an arch function, then
we have to make vm_insert_mixed (next patch) an arch function too. So I
don't think moving it to arch code fundamentally improves any abstractions,
while it does practically make the code more difficult to follow, for both
mm and arch developers, and easier to misuse.

[akpm@linux-foundation.org: build fix]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: Carsten Otte <cotte@de.ibm.com>
Cc: Jared Hulbert <jaredeh@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-28 08:58:23 -07:00
..
sn [IA64] move XP and XPC to drivers/misc/sgi-xp 2008-04-22 15:08:17 -07:00
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
acpi-ext.h
acpi.h [IA64] Minimize per_cpu reservations. 2008-04-08 13:51:35 -07:00
agp.h x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asmmacro.h [IA64] remove per-cpu ia64_phys_stacked_size_p8 2007-02-06 15:04:18 -08:00
atomic.h [IA64] Use atomic64_read to read an atomic64_t. 2007-08-13 10:21:04 -07:00
auxvec.h
bitops.h generic: implement __fls on all 64-bit archs 2008-04-26 19:21:16 +02:00
break.h
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
checksum.h [PATCH] fix prototype of csum_ipv6_magic() (ia64) 2007-01-23 11:09:49 -08:00
compat.h asm-*/compat.h: fix typo in comment 2008-02-03 16:32:51 +02:00
cpu.h
cputime.h [IA64] VIRT_CPU_ACCOUNTING (accurate cpu time accounting) 2008-02-20 12:55:37 -08:00
current.h
cyclone.h
delay.h
device.h
div64.h
dma-mapping.h IA64: sg chaining support 2007-10-16 11:27:26 +02:00
dma.h [IA64] swiotlb bug fixes 2007-02-05 18:46:40 -08:00
dmi.h
elf.h [IA64] use CORE_DUMP_USE_REGSET 2008-03-12 16:27:35 -07:00
emergency-restart.h
errno.h
esi.h [IA64] remove bogus prototype ia64_esi_init() 2007-02-05 14:14:29 -08:00
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h
fpswa.h
fpu.h
futex.h
gcc_intrin.h KVM: ia64: Prepare some structure and routines for kvm use 2008-04-27 12:01:01 +03:00
hardirq.h
hpsim.h [IA64] Cleanup HPSIM code (was: Re: Enable early console for Ski simulator) 2007-09-01 02:52:25 -07:00
hw_irq.h [IA64] Fix irq migration in multiple vector domain 2008-03-04 14:16:20 -08:00
ia32.h [IA64] rename partial_page 2007-07-25 12:56:39 -07:00
ia64regs.h
ide.h ide: remove ide_init_default_irq() macro 2008-04-18 00:46:35 +02:00
intel_intrin.h IA64: Slim down __clear_bit_unlock 2007-12-18 16:22:46 -08:00
intrinsics.h Add cmpxchg_local, cmpxchg64 and cmpxchg64_local to ia64 2008-02-07 08:42:32 -08:00
io.h Remove dma_cache_(wback|inv|wback_inv) functions 2007-10-17 08:42:57 -07:00
ioctl.h
ioctls.h [IA64] arbitary speed tty ioctl support 2007-07-13 16:04:12 -07:00
iosapic.h [IA64] iosapic cleanup 2007-12-07 16:11:12 -08:00
ipcbuf.h
irq_regs.h
irq.h take declarations of enable_irq() et.al. to linux/interrupt.h 2007-07-22 11:44:00 -07:00
Kbuild [IA64] move gcc_intrin.h from header-y to unifdef-y 2008-03-04 14:27:49 -08:00
kdebug.h x86: optimize page faults like all other achitectures and kill notifier cruft 2007-10-16 09:42:50 -07:00
kexec.h kdump/kexec: calculate note size at compile time 2007-05-08 11:15:07 -07:00
kmap_types.h
kprobes.h [IA64] kprobes: kprobe-booster for ia64 2008-04-09 10:36:43 -07:00
kregs.h [IA64] Add API for allocating Dynamic TR resource. 2008-04-03 11:02:58 -07:00
kvm_host.h KVM: Rename VCPU_MP_STATE_* to KVM_MP_STATE_* 2008-04-27 12:04:13 +03:00
kvm_para.h KVM: ia64: Add header files for kvm/ia64 2008-04-27 12:01:02 +03:00
kvm.h KVM: ia64: Add header files for kvm/ia64 2008-04-27 12:01:02 +03:00
libata-portmap.h ATA convert GSI to irq on ia64 2007-02-15 18:04:53 -05:00
linkage.h
local.h local_t: ia64 extension 2007-05-08 11:15:20 -07:00
machvec_dig.h
machvec_hpsim.h
machvec_hpzx1_swiotlb.h
machvec_hpzx1.h
machvec_init.h [IA64] SN2 needs platform specific irq_to_vector() function. 2007-08-13 10:31:26 -07:00
machvec_sn2.h [IA64] SN2 needs platform specific irq_to_vector() function. 2007-08-13 10:31:26 -07:00
machvec.h [IA64] SN2 needs platform specific irq_to_vector() function. 2007-08-13 10:31:26 -07:00
mc146818rtc.h
mca_asm.h [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca.h [IA64] simplify notify hooks in mca.c 2008-04-22 08:56:38 -07:00
meminit.h [IA64] Fix NUMA configuration issue 2008-04-11 15:21:35 -07:00
mman.h
mmu_context.h [PATCH] x86: PARAVIRT: add hooks to intercept mm creation and destruction 2007-05-02 19:27:14 +02:00
mmu.h
mmzone.h
module.h
msgbuf.h
mutex.h
namei.h
nodedata.h
numa.h [IA64] Minimize per_cpu reservations. 2008-04-08 13:51:35 -07:00
page.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pal.h [IA64] Itanium Spec updates 2008-04-09 13:05:54 -07:00
param.h [IA64] Fix build for sim_defconfig 2008-02-11 13:23:46 -08:00
parport.h
patch.h [IA64] remove per-cpu ia64_phys_stacked_size_p8 2007-02-06 15:04:18 -08:00
pci.h [IA64] Un-break ia64 build 2007-07-12 16:04:39 -07:00
percpu.h ia64: on UP percpu variables are not small memory model 2008-01-30 23:27:58 +01:00
perfmon_default_smpl.h
perfmon.h
pgalloc.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgtable.h mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
poll.h Consolidate asm/poll.h 2007-05-11 08:29:34 -07:00
posix_types.h [PATCH] FD_ZERO build fix 2007-01-11 18:18:22 -08:00
processor.h KVM: ia64: Prepare some structure and routines for kvm use 2008-04-27 12:01:01 +03:00
ptrace_offsets.h
ptrace.h [IA64] remove duplicate code from arch_ptrace() 2008-03-05 15:49:11 -08:00
resource.h [IA64] Remove stack hard limit on ia64 2007-03-06 14:48:19 -08:00
rse.h
rwsem.h [IA64] Prevent people from directly including <asm/rwsem.h>. 2007-07-20 11:27:11 -07:00
sal.h [IA64] Kernel parameter for max number of concurrent global TLB purges 2008-04-04 11:06:38 -07:00
scatterlist.h Add CONFIG_DEBUG_SG sg validation 2007-10-22 21:20:03 +02:00
sections.h [IA64] remove per-cpu ia64_phys_stacked_size_p8 2007-02-06 15:04:18 -08:00
segment.h
semaphore.h Generic semaphore implementation 2008-04-17 10:42:34 -04:00
sembuf.h
serial.h
setup.h [PATCH] ia64: 2048-byte command line 2007-02-12 09:48:39 -08:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h [IA64] Implement smp_call_function_mask for ia64 2008-04-03 11:39:43 -07:00
socket.h [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
sockios.h [NET]: Introduce SIOCGSTAMPNS ioctl to get timestamps with nanosec resolution 2007-04-25 22:24:04 -07:00
sparsemem.h
spinlock_types.h
spinlock.h remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
stat.h
statfs.h
string.h
suspend.h
system.h [IA64] VIRT_CPU_ACCOUNTING (accurate cpu time accounting) 2008-02-20 12:55:37 -08:00
termbits.h [IA64] arbitary speed tty ioctl support 2007-07-13 16:04:12 -07:00
termios.h [IA64] arbitary speed tty ioctl support 2007-07-13 16:04:12 -07:00
thread_info.h [IA64] VIRT_CPU_ACCOUNTING (accurate cpu time accounting) 2008-02-20 12:55:37 -08:00
timex.h
tlb.h [IA64] Add API for allocating Dynamic TR resource. 2008-04-03 11:02:58 -07:00
tlbflush.h [IA64] Multiple outstanding ptc.g instruction support 2008-04-04 11:05:59 -07:00
topology.h sched, cpuset: customize sched domains, core 2008-04-19 19:45:00 +02:00
types.h
uaccess.h
ucontext.h
unaligned.h
uncached.h
unistd.h [IA64] Wire up timerfd_{create,settime,gettime} syscalls 2008-02-08 12:00:32 -08:00
unwind.h [IA64] Remove sparse warning from unwind code 2007-03-08 10:28:48 -08:00
user.h Sanitize the type of struct user.u_ar0 2008-02-07 08:42:30 -08:00
ustack.h arch: personality independent stack top 2007-07-19 10:04:45 -07:00
vga.h
xor.h