WSL2-Linux-Kernel/include/asm-arm
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
..
arch-aaec2000 Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
arch-at91 [ARM] 4913/1: [AT91] PMC_MDIV definitions 2008-04-10 14:57:20 +01:00
arch-cl7500
arch-clps711x
arch-davinci [ARM] 4634/1: DaVinci GPIO header build fix 2007-10-31 15:21:52 +00:00
arch-ebsa110
arch-ebsa285
arch-ep93xx [ARM] 4988/1: Add GPIO lib support to the EP93xx 2008-04-19 14:01:43 +01:00
arch-h720x
arch-imx imxfb: fast read flag and nonstandard field configurable 2007-10-16 09:43:21 -07:00
arch-integrator
arch-iop13xx iop-adma: remove the workaround for missed interrupts on iop3xx 2008-04-17 13:25:54 -07:00
arch-iop32x
arch-iop33x
arch-ixp4xx Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-02-04 15:29:53 -08:00
arch-ixp23xx [ARM] 4680/1: parentheses around NR_IRQS definition 2007-11-29 20:56:57 +00:00
arch-ixp2000
arch-ks8695 [ARM] 4981/1: [KS8695] Simple LED driver 2008-04-17 15:58:25 +01:00
arch-l7200
arch-lh7a40x
arch-msm [ARM] msm: dma support for MSM7X00A 2008-01-26 14:39:14 +00:00
arch-mxc [ARM] 4887/1: i.MXC family: Separate current platform code 2008-04-17 16:15:17 +01:00
arch-netx
arch-ns9xxx ns9xxx: let putc autodetect where to write 2008-03-31 08:17:01 +02:00
arch-omap Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc 2008-04-21 17:23:30 -07:00
arch-orion5x Orion: orion -> orion5x rename 2008-03-27 14:51:41 -04:00
arch-pnx4008
arch-pxa [MTD] [NAND] support for pxa3xx 2008-04-22 19:27:27 +01:00
arch-realview RealView: Add uncompressing support for PB1176 2008-04-18 22:43:16 +01:00
arch-rpc [ARM] 4564/1: Add tagged list support for Acorn RiscPC's uncompress code 2007-10-12 23:43:11 +01:00
arch-s3c2400
arch-s3c2410 Merge branch 'merge-fixes' into devel 2008-04-19 17:17:34 +01:00
arch-sa1100 ide: add struct ide_io_ports (take 3) 2008-04-27 15:38:32 +02:00
arch-shark
arch-versatile fix typo 'the same the\>' 2008-02-03 14:59:11 +02:00
hardware Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial 2008-04-21 16:36:46 -07:00
mach iop: unconditionally initialize the ATU on platforms known to be 'hosts' 2008-03-26 12:33:41 -07:00
plat-orion plat-orion: make orion_nand available for all Orion families 2008-03-27 14:51:40 -04:00
plat-s3c [MTD] [NAND] S3C2410 Allow ECC disable to be specified by the board 2008-04-22 21:41:32 +01:00
plat-s3c24xx [ARM] 4786/1: S3C2412: Add SPI FIFO controll constants 2008-01-28 13:20:51 +00:00
.gitignore
Kbuild
a.out-core.h aout: suppress A.OUT library support if !CONFIG_ARCH_SUPPORTS_AOUT 2008-02-08 09:22:30 -08:00
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
assembler.h
atomic.h
auxvec.h
bitops.h ext4: Add ext4_find_next_bit() 2008-01-28 23:58:27 -05:00
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h [ARM] Marvell Feroceon CPU core support 2008-01-26 15:03:38 +00:00
checksum.h
cnt32_to_63.h
cpu-multi32.h Add a prefetch abort handler 2008-04-18 22:43:07 +01:00
cpu-single.h
cpu.h
cputime.h
current.h
delay.h
device.h
div64.h
dma-mapping.h arm: sg fallout 2007-10-23 12:37:59 +02:00
dma.h
domain.h
dyntick.h
ecard.h
elf.h Cleanup asm/{elf,page,user}.h: #ifdef __KERNEL__ is no longer needed 2008-02-07 08:42:30 -08:00
emergency-restart.h
errno.h
fb.h
fcntl.h
fiq.h
flat.h [ARM] nommu: fix breakage caused by f9720205d1 2007-10-31 15:21:42 +00:00
floppy.h cleanup floppy.h 2007-10-17 08:42:55 -07:00
fpstate.h [ARM] 4583/1: ARMv7: Add VFPv3 support 2008-01-26 14:41:28 +00:00
futex.h
glue.h Add a prefetch abort handler 2008-04-18 22:43:07 +01:00
gpio.h
hardirq.h
hardware.h
hw_irq.h
hwcap.h ARMv7: Add support for the ThumbEE state saving/restoring 2008-04-18 22:43:06 +01:00
ide.h ide: remove ide_default_io_ctl() macro 2008-04-18 00:46:34 +02:00
io.h endianness annotations in arm io.h 2007-10-14 12:41:52 -07:00
ioctl.h
ioctls.h
ipcbuf.h
irq.h
irq_regs.h
irqflags.h
kdebug.h
kexec.h [ARM] 4838/1: Fix kexec for SA1100 machines 2008-02-29 22:47:09 +00:00
kmap_types.h
kprobes.h Kprobes: indicate kretprobe support in Kconfig 2008-03-04 16:35:11 -08:00
kvm.h kvm: provide kvm.h for all architecture: fixes headers_install 2008-04-02 15:28:18 -07:00
leds.h
limits.h
linkage.h
local.h
locks.h
mc146818rtc.h
memory.h [ARM] Add initial sparsemem support 2008-04-19 11:36:48 +01:00
mman.h
mmu.h
mmu_context.h
mmzone.h
module.h
msgbuf.h
mtd-xip.h
mutex.h misc: removal of final callers using fastcall 2008-02-08 09:22:31 -08:00
namei.h
nwflash.h
page-nommu.h
page.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
param.h
parport.h
pci.h [ARM] 4577/1: ITE 8152 PCI bridge support 2007-10-15 18:53:59 +01:00
percpu.h
pgalloc.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgtable-hwdef.h
pgtable-nommu.h [ARM] 4850/1: include generic pgtable.h for !CONFIG_MMU case 2008-03-06 12:18:18 +00:00
pgtable.h mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
poll.h
posix_types.h asm-*/posix_types.h: scrub __GLIBC__ 2008-02-08 09:22:34 -08:00
proc-fns.h [ARM] include/asm-arm - use angle brackets for includes 2008-03-06 12:18:18 +00:00
processor.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
procinfo.h
ptrace.h
resource.h
rtc.h
scatterlist.h Add CONFIG_DEBUG_SG sg validation 2007-10-22 21:20:03 +02:00
sections.h
segment.h
semaphore.h Generic semaphore implementation 2008-04-17 10:42:34 -04:00
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
sizes.h
smp.h [ARM] 4814/1: RealView: Add broadcasting clockevents support for ARM11MPCore 2008-02-04 17:52:19 +00:00
socket.h [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
sockios.h
sparsemem.h [ARM] Add initial sparsemem support 2008-04-19 11:36:48 +01:00
spinlock.h
spinlock_types.h
stat.h
statfs.h
string.h
suspend.h
system.h Add cmpxchg_local to arm 2008-02-07 08:42:31 -08:00
termbits.h
termios.h
therm.h
thread_info.h ARMv7: Add support for the ThumbEE state saving/restoring 2008-04-18 22:43:06 +01:00
thread_notify.h
timex.h
tlb.h add mm argument to pte/pmd/pud/pgd_free 2008-02-05 09:44:18 -08:00
tlbflush.h remove unused flush_tlb_pgtables 2007-10-19 11:53:34 -07:00
topology.h
traps.h ARM kprobes: prevent some functions involved with kprobes from being probed 2008-01-26 15:25:17 +00:00
types.h remove strict ansi check from __u64 in asm/types.h 2007-10-17 08:42:53 -07:00
uaccess.h
ucontext.h
unaligned.h [ARM] 4837/1: make __get_unaligned_*() return unsigned types 2008-02-29 22:46:48 +00:00
unistd.h [ARM] 4852/1: Add timerfd_create, timerfd_settime and timerfd_gettime syscall entries 2008-04-19 11:28:06 +01:00
user.h Sanitize the type of struct user.u_ar0 2008-02-07 08:42:30 -08:00
vfp.h [ARM] 4583/1: ARMv7: Add VFPv3 support 2008-01-26 14:41:28 +00:00
vfpmacros.h [ARM] 4583/1: ARMv7: Add VFPv3 support 2008-01-26 14:41:28 +00:00
vga.h
xor.h