linux_old1/include/asm-m32r
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
..
m32104ut [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
m32700ut m32r: remove dead config symbols from M32R code 2008-02-05 09:44:08 -08:00
mappi2 [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
mappi3 [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
opsput [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
Kbuild m32r: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
addrspace.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
assembler.h m32r: Rename STI/CLI macros 2007-09-06 11:10:56 +09:00
atomic.h atomic_t: unify all arch definitions 2009-01-06 15:59:10 -08:00
auxvec.h [PATCH] auxiliary vector cleanups 2005-09-07 16:57:21 -07:00
bitops.h m32r: define __fls 2009-01-03 16:16:54 +10:30
bug.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bugs.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
byteorder.h m32r: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
cache.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
cachectl.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cacheflush.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
checksum.h [NET]: M32R checksum annotations and cleanups. 2006-12-02 21:23:06 -08:00
cputime.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
current.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
delay.h Fix __const_udelay declaration and definition mismatches 2008-02-06 10:41:06 -08:00
device.h Driver core: add dev_archdata to struct device 2006-12-01 14:52:01 -08:00
div64.h [PATCH] m32r: Use asm-generic/div64.h 2005-06-21 19:07:31 -07:00
dma.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
elf.h [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
emergency-restart.h [PATCH] Add emergency_restart() 2005-07-26 14:35:41 -07:00
errno.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h [PATCH] Clean up struct flock64 definitions 2005-09-07 16:57:38 -07:00
flat.h Binfmt_flat: Add minimum support for the Blackfin relocations 2007-10-03 23:41:43 +08:00
futex.h [PATCH] consolidate asm/futex.h 2006-01-08 20:13:39 -08:00
hardirq.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
hw_irq.h [PATCH] genirq: add ->retrigger() irq op to consolidate hw_irq_resend() 2006-06-29 10:26:23 -07:00
io.h [PATCH] Consolidate check_signature 2006-10-11 11:14:23 -07:00
ioctl.h [PATCH] Generic ioctl.h 2006-01-10 08:01:34 -08:00
ioctls.h m32r: enable arbitary speed tty rate setting 2007-07-16 09:05:38 -07:00
ipcbuf.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
irq.h m32r: remove dead config symbols from M32R code 2008-02-05 09:44:08 -08:00
irq_regs.h [PATCH] m32r pt_regs fixes 2006-10-07 10:51:15 -07:00
kdebug.h move die notifier handling to common code 2007-05-08 11:15:04 -07:00
kmap_types.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
linkage.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
local.h local_t m32r use architecture specific cmpxchg_local 2008-02-07 08:42:32 -08:00
m32r.h m32r: Define symbols to unify platform-dependent ICU checks 2007-09-03 11:30:18 +09:00
m32r_mp_fpga.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
m32102.h [PATCH] m32r: support a synthesizable M32700 core 2006-12-08 08:28:37 -08:00
mc146818rtc.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
mman.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
mmu.h NOMMU: Make VMAs per MM as for MMU-mode linux 2009-01-08 12:04:47 +00:00
mmu_context.h [PATCH] x86: PARAVIRT: add hooks to intercept mm creation and destruction 2007-05-02 19:27:14 +02:00
mmzone.h [PATCH] unify pfn_to_page: m32r pfn_to_page 2006-03-27 08:44:45 -08:00
module.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
msgbuf.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
mutex.h [PATCH] mutex subsystem, add default include/asm-*/mutex.h files 2006-01-09 15:59:19 -08:00
page.h PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
param.h avoid overflows in kernel/time.c 2008-02-08 09:22:39 -08:00
pci.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
percpu.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pgalloc.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgtable-2level.h m32r: fix pte_to_pgoff(), pgoff_to_pte() and __swp_type() macros 2007-05-11 08:29:33 -07: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 asm-*/posix_types.h: scrub __GLIBC__ 2008-02-08 09:22:34 -08:00
processor.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
ptrace.h m32r: convert to generic sys_ptrace 2007-10-16 09:43:04 -07:00
resource.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
rtc.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
s1d13806.h [PATCH] m32r: framebuffer device support 2005-07-07 18:24:11 -07:00
scatterlist.h Add CONFIG_DEBUG_SG sg validation 2007-10-22 21:20:03 +02:00
sections.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
segment.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
sembuf.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
serial.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
setup.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
shmbuf.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
shmparam.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
sigcontext.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
siginfo.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
signal.h core: remove last users of empty FASTCALL macro 2008-01-30 13:31:17 +01:00
smp.h cpumask: centralize cpu_online_map and cpu_possible_map 2008-12-13 21:19:41 +10:30
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
spinlock.h [PATCH] Directed yield: cpu_relax variants for spinlocks and rw-locks 2006-10-01 00:39:21 -07:00
spinlock_types.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
stat.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
statfs.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
string.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
swab.h m32r: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
syscall.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
system.h sched: rename SCHED_NO_NO_OMIT_FRAME_POINTER => SCHED_OMIT_FRAME_POINTER 2008-11-11 08:59:20 +01:00
termbits.h m32r: enable arbitary speed tty rate setting 2007-07-16 09:05:38 -07:00
termios.h m32r: enable arbitary speed tty rate setting 2007-07-16 09:05:38 -07:00
thread_info.h clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
timex.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
tlb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tlbflush.h remove unused flush_tlb_pgtables 2007-10-19 11:53:34 -07:00
topology.h [PATCH] m32r: build fix for asm-m32r/topology.h 2005-06-23 09:45:08 -07:00
types.h m32r: types: use <asm-generic/int-*.h> for the m32r architecture 2008-05-02 16:18:21 -07:00
uaccess.h asm-m32r/uaccess.h must #include <asm/setup.h> 2008-06-06 11:29:13 -07:00
ucontext.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
unaligned.h kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
unistd.h timerfd: fix remaining architectures 2008-02-05 14:37:15 -08:00
user.h Sanitize the type of struct user.u_ar0 2008-02-07 08:42:30 -08:00
vga.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00
xor.h [PATCH] m32r: cosmetic updates and trivial fixes 2007-02-11 10:51:20 -08:00