linux/arch/arm/include/asm
David Howells 8feae13110 NOMMU: Make VMAs per MM as for MMU-mode linux
Make VMAs per mm_struct as for MMU-mode linux.  This solves two problems:

 (1) In SYSV SHM where nattch for a segment does not reflect the number of
     shmat's (and forks) done.

 (2) In mmap() where the VMA's vm_mm is set to point to the parent mm by an
     exec'ing process when VM_EXECUTABLE is specified, regardless of the fact
     that a VMA might be shared and already have its vm_mm assigned to another
     process or a dead process.

A new struct (vm_region) is introduced to track a mapped region and to remember
the circumstances under which it may be shared and the vm_list_struct structure
is discarded as it's no longer required.

This patch makes the following additional changes:

 (1) Regions are now allocated with alloc_pages() rather than kmalloc() and
     with no recourse to __GFP_COMP, so the pages are not composite.  Instead,
     each page has a reference on it held by the region.  Anything else that is
     interested in such a page will have to get a reference on it to retain it.
     When the pages are released due to unmapping, each page is passed to
     put_page() and will be freed when the page usage count reaches zero.

 (2) Excess pages are trimmed after an allocation as the allocation must be
     made as a power-of-2 quantity of pages.

 (3) VMAs are added to the parent MM's R/B tree and mmap lists.  As an MM may
     end up with overlapping VMAs within the tree, the VMA struct address is
     appended to the sort key.

 (4) Non-anonymous VMAs are now added to the backing inode's prio list.

 (5) Holes may be punched in anonymous VMAs with munmap(), releasing parts of
     the backing region.  The VMA and region structs will be split if
     necessary.

 (6) sys_shmdt() only releases one attachment to a SYSV IPC shared memory
     segment instead of all the attachments at that addresss.  Multiple
     shmat()'s return the same address under NOMMU-mode instead of different
     virtual addresses as under MMU-mode.

 (7) Core dumping for ELF-FDPIC requires fewer exceptions for NOMMU-mode.

 (8) /proc/maps is now the global list of mapped regions, and may list bits
     that aren't actually mapped anywhere.

 (9) /proc/meminfo gains a line (tagged "MmapCopy") that indicates the amount
     of RAM currently allocated by mmap to hold mappable regions that can't be
     mapped directly.  These are copies of the backing device or file if not
     anonymous.

These changes make NOMMU mode more similar to MMU mode.  The downside is that
NOMMU mode requires some extra memory to track things over NOMMU without this
patch (VMAs are no longer shared, and there are now region structs).

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Mike Frysinger <vapier.adi@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
2009-01-08 12:04:47 +00:00
..
hardware [ARM] VIC: Update asm/hardware/vic.h with PL192 information 2008-12-15 23:03:10 +00:00
mach PCI: arm: use generic INTx swizzle from PCI core 2009-01-07 11:13:13 -08:00
Kbuild arm: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
a.out-core.h
a.out.h
assembler.h
atomic.h atomic_t: unify all arch definitions 2009-01-06 15:59:10 -08:00
auxvec.h
bitops.h [ARM] 5339/1: fix __fls() on ARM 2008-12-04 09:21:55 +00:00
bug.h [ARM] 5211/2: fix a couple warnings from BUG() usage 2008-09-01 12:06:27 +01:00
bugs.h
byteorder.h arm: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
cache.h
cacheflush.h [ARM] Remove linux/sched.h from asm/cacheflush.h and asm/uaccess.h 2008-11-29 18:49:55 +00:00
cachetype.h [ARM] Introduce new bitmask based cache type macros 2008-09-25 15:35:28 +01:00
checksum.h
clkdev.h [ARM] clkdev: add generic clkdev infrastructure 2008-11-27 12:38:21 +00:00
cpu-multi32.h
cpu-single.h
cpu.h
cputime.h
cputype.h [ARM] cputype: separate definitions, use them 2008-09-01 12:06:23 +01:00
current.h
delay.h
device.h
div64.h [ARM] 5320/1: fix assembly constraints in implementation of do_div() 2008-10-23 12:53:32 +01:00
dma-mapping.h [ARM] dma: correct dma_supported() implementation 2008-12-13 09:12:07 +00:00
dma.h [ARM] Rename ISA mach/dma.h header to mach/isa-dma.h 2008-11-29 18:49:55 +00:00
domain.h
ecard.h
elf.h [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
emergency-restart.h
errno.h
fb.h
fcntl.h
fiq.h
flat.h
floppy.h [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
fpstate.h
ftrace.h ftrace: rename FTRACE to FUNCTION_TRACER 2008-10-20 18:27:03 +02:00
futex.h [ARM] 5218/1: arm: improved futex support 2008-09-01 12:06:26 +01:00
glue.h
gpio.h [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
hardirq.h
hw_irq.h
hwcap.h Add HWCAP_NEON to the ARM hwcap.h file 2008-11-06 13:23:07 +00:00
ide.h
io.h [ARM] Add a common typesafe __io implementation 2008-11-30 11:45:54 +00:00
ioctl.h
ioctls.h
ipcbuf.h
irq.h [ARM] give RiscPC a NR_IRQS definition and remove default 2008-11-29 19:14:31 +00:00
irq_regs.h
irqflags.h
kdebug.h
kexec.h kexec jump: rename KEXEC_CONTROL_CODE_SIZE to KEXEC_CONTROL_PAGE_SIZE 2008-08-15 08:35:42 -07:00
kgdb.h
kmap_types.h
kprobes.h [ARM] 5206/1: remove kprobe_trap_handler() hack 2008-09-01 12:06:26 +01:00
leds.h
limits.h
linkage.h
local.h
locks.h
mc146818rtc.h [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
memory.h [ARM] remove a common set of __virt_to_bus definitions 2008-11-28 15:36:49 +00:00
mman.h
mmu.h NOMMU: Make VMAs per MM as for MMU-mode linux 2009-01-08 12:04:47 +00:00
mmu_context.h [ARM] Remove linux/sched.h from asm/cacheflush.h and asm/uaccess.h 2008-11-29 18:49:55 +00:00
mmzone.h [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
module.h
msgbuf.h
mtd-xip.h [ARM] move asm/xip.h's mach/hardware.h include to mach/xip.h 2008-12-14 13:22:51 +00:00
mutex.h
nwflash.h
page-nommu.h
page.h Merge branch 'highmem' into devel 2008-11-28 15:39:02 +00:00
param.h
parport.h
pci.h [ARM] Fix PCI_DMA_BUS_IS_PHYS for ARM 2008-09-13 21:35:55 +01:00
percpu.h
pgalloc.h
pgtable-hwdef.h
pgtable-nommu.h
pgtable.h Merge branch 'ptebits' into devel 2008-10-09 21:31:56 +01:00
poll.h
posix_types.h
proc-fns.h
processor.h Merge branch 'omap3-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel 2008-12-15 22:13:26 +00:00
procinfo.h
ptrace.h [ARM] remove pc_pointer() 2008-09-06 10:35:51 +01:00
resource.h
scatterlist.h
sections.h
segment.h
sembuf.h
serial.h
setup.h [ARM] rationalize memory configuration code some more 2008-11-28 15:36:44 +00:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
sizes.h
smp.h RealView: Use only the shadow mapping of ARM11MPCore local timers 2008-12-01 14:54:57 +00:00
socket.h
sockios.h
sparsemem.h [ARM] mm: enable sparsemem on clps7500 and RiscPC 2008-10-01 17:24:04 +01:00
spinlock.h
spinlock_types.h
stat.h
statfs.h ARM: Use <asm-generic/statfs.h> 2008-09-04 09:46:11 +01:00
string.h [ARM] remove memzero() 2008-11-27 12:37:59 +00:00
suspend.h
swab.h arm: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
system.h [ARM] asm/system.h does not require asm/memory.h 2008-11-28 23:20:38 +00:00
termbits.h
termios.h
therm.h
thread_info.h [ARM] remove pc_pointer() 2008-09-06 10:35:51 +01:00
thread_notify.h
timex.h [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
tlb.h
tlbflush.h [ARM] 5192/1: ARM TLB: add v7wbi_{possible,always}_flags to {possible,always}_tlb_flags 2008-08-12 19:54:08 +01:00
topology.h
traps.h
types.h
uaccess.h [ARM] Remove linux/sched.h from asm/cacheflush.h and asm/uaccess.h 2008-11-29 18:49:55 +00:00
ucontext.h
unaligned.h
unistd.h [ARM] 5193/1: Wire up missing syscalls 2008-08-12 19:54:07 +01:00
user.h
vfp.h
vfpmacros.h
vga.h [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
xor.h