android_kernel_xiaomi_sm8350/arch/sh/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
..
.gitignore
adc.h
addrspace.h sh: P4 ioremap pass-through 2008-12-22 18:43:48 +09:00
atomic-grb.h
atomic-irq.h
atomic-llsc.h
atomic.h atomic_t: unify all arch definitions 2009-01-06 15:59:10 -08:00
auxvec.h
bitops-grb.h sh: Convert to generic bitops for IRQ-toggling implementation. 2008-12-22 18:42:53 +09:00
bitops-llsc.h sh: Convert to generic bitops for IRQ-toggling implementation. 2008-12-22 18:42:53 +09:00
bitops-op32.h sh: Provide optimized non-atomic bitops for SH-2A. 2008-12-22 18:42:54 +09:00
bitops.h sh: Provide optimized non-atomic bitops for SH-2A. 2008-12-22 18:42:54 +09:00
bug.h
bugs.h sh: Add support for SH7201 CPU subtype. 2008-12-22 18:43:50 +09:00
byteorder.h sh: introduce asm/swab.h 2009-01-06 18:10:27 -08:00
cache.h
cacheflush.h
checksum_32.h
checksum_64.h
checksum.h
clock.h sh: fixup many sparse errors. 2008-09-08 10:35:04 +09:00
cmpxchg-grb.h
cmpxchg-irq.h
cmpxchg-llsc.h sh: Provide movli.l/movco.l-based cmpxchg. 2008-09-08 10:35:02 +09:00
cpu-features.h
cputime.h
current.h
delay.h
device.h
div64.h
dma-mapping.h
dma.h
dmabrg.h
elf.h Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-12-28 12:33:21 -08:00
emergency-restart.h
entry-macros.S
errno.h
fb.h
fcntl.h
fixmap.h
flat.h sh: Provide a FLAT_PLAT_INIT() definition. 2008-08-11 20:17:55 +09:00
fpu.h sh: Add FPU registers to regset interface. 2008-09-21 19:04:55 +09:00
freq.h
ftrace.h sh: Provide a dyn_arch_ftrace struct definition. 2008-12-22 18:43:50 +09:00
futex-irq.h
futex.h
gpio.h sh: asm/gpio.h needs linux/kernel.h for might_sleep()/WARN_ON(). 2008-10-23 12:37:20 +09:00
hardirq.h
hd64461.h
heartbeat.h
hugetlb.h
hw_irq.h sh: Move the shared INTC code out to drivers/sh/ 2008-10-01 16:13:54 +09:00
i2c-sh7760.h
ilsel.h
io_generic.h sh: More I/O routine overhauling. 2008-10-04 05:25:52 +09:00
io_trapped.h
io.h sh: P4 ioremap pass-through 2008-12-22 18:43:48 +09:00
ioctl.h
ioctls.h
ipcbuf.h
irq_regs.h
irq.h sh: fixup many sparse errors. 2008-09-08 10:35:04 +09:00
irqflags_32.h
irqflags_64.h
irqflags.h
Kbuild sh: introduce asm/swab.h 2009-01-06 18:10:27 -08:00
kdebug.h sh: Wire up oops reporting in the die notifier chain. 2008-10-21 18:33:36 +09:00
kexec.h kexec jump: rename KEXEC_CONTROL_CODE_SIZE to KEXEC_CONTROL_PAGE_SIZE 2008-08-15 08:35:42 -07:00
kgdb.h sh: Generic kgdb stub support. 2008-12-22 18:44:04 +09:00
kmap_types.h
kprobes.h sh: kprobes: Use trapa #0x3a for breakpoint trap. 2008-09-08 18:10:10 +09:00
linkage.h
local.h
machvec.h sh: mach-edosk7705: Fix up edosk7705 so it all builds again. 2008-12-22 18:44:45 +09:00
mc146818rtc.h
mman.h
mmu_context_32.h
mmu_context_64.h
mmu_context.h sh: Fix up the cpu_asid() return value on nommu. 2008-12-22 18:44:03 +09:00
mmu.h NOMMU: Make VMAs per MM as for MMU-mode linux 2009-01-08 12:04:47 +00:00
mmzone.h sh: Fix up NUMA build error with se7722_defconfig. 2008-09-12 22:41:30 +09:00
module.h
msgbuf.h
mutex-llsc.h sh: Fix an off-by-1 check in __mutex_fastpath_unlock(). 2008-12-22 18:44:02 +09:00
mutex.h sh: Add SH-4A optimized fastpath mutex implementation. 2008-12-22 18:42:55 +09:00
page.h sh: ioremap_prot support. 2008-09-12 20:41:05 +09:00
param.h
parport.h
pci.h
percpu.h
pgalloc.h
pgtable_32.h
pgtable_64.h
pgtable.h sh: Handle fixmap TLB eviction more coherently. 2008-11-10 20:00:45 +09:00
poll.h
posix_types_32.h
posix_types_64.h
posix_types.h
processor_32.h sh: Conditionalize the code dumper on CONFIG_DUMP_CODE. 2008-12-22 18:44:47 +09:00
processor_64.h sh: Enable HAVE_ARCH_TRACEHOOK for all SH, now that SH-5 supports it too. 2008-12-22 18:44:04 +09:00
processor.h sh: Add support for SH7201 CPU subtype. 2008-12-22 18:43:50 +09:00
ptrace.h sh: Provide linux/regset.h interface for SH-5. 2008-12-22 18:44:04 +09:00
push-switch.h
resource.h
rtc.h sh: fixup many sparse errors. 2008-09-08 10:35:04 +09:00
rwsem.h
scatterlist.h
seccomp.h sh: seccomp support. 2008-08-02 04:39:32 +09:00
sections.h
segment.h
sembuf.h
serial.h sh: Kill off long-dead HD64465 cchip support. 2008-10-28 20:07:44 +09:00
setup.h sh: Fix up headers_check regression. 2008-09-17 23:24:59 +09:00
sfp-machine.h
sh7760fb.h
sh_bios.h sh: Kill off sh_bios_in_gdb_mode(). 2008-12-22 18:44:44 +09:00
sh_eth.h [netdrvr] sh_eth: Add SH7619 support 2008-08-07 02:20:57 -04:00
sh_keysc.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
sizes.h sh: Add a few more definitions to asm/sizes.h. 2008-09-21 10:31:57 +09:00
smc37c93x.h
smp.h cpumask: convert struct clock_event_device to cpumask pointers. 2008-12-13 21:20:26 +10:30
socket.h
sockios.h
sparsemem.h
spi.h
spinlock_types.h
spinlock.h
stat.h
statfs.h
string_32.h
string_64.h sh: Add SH-5 optimized memcpy()/memset()/strcpy()/strlen(). 2008-12-22 18:44:05 +09:00
string.h
swab.h sh: introduce asm/swab.h 2009-01-06 18:10:27 -08:00
syscall_32.h sh: Fix up syscall_get_nr() comment in syscall_32.h. 2008-12-22 18:44:04 +09:00
syscall_64.h sh: Enable HAVE_ARCH_TRACEHOOK for all SH, now that SH-5 supports it too. 2008-12-22 18:44:04 +09:00
syscall.h sh: Provide the asm/syscall.h interface, needed by tracehook. 2008-09-12 22:13:13 +09:00
syscalls_32.h sh: fixup many sparse errors. 2008-09-08 10:35:04 +09:00
syscalls_64.h sh: fixup many sparse errors. 2008-09-08 10:35:04 +09:00
syscalls.h sh: fixup many sparse errors. 2008-09-08 10:35:04 +09:00
system_32.h sh: Move lookup_exception_vector() out to asm/system_32.h. 2008-09-21 12:00:23 +09:00
system_64.h
system.h sh: Generic kgdb stub support. 2008-12-22 18:44:04 +09:00
termbits.h
termios.h
thread_info.h sh: Support kernel stacks smaller than a page. 2008-09-20 20:21:33 +09:00
timer.h
timex.h
tlb_64.h sh: Fix up broken kerneldoc comments. 2008-08-04 12:51:06 +09:00
tlb.h
tlbflush.h
topology.h Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into merge-rr-cpumask 2009-01-03 18:53:31 +01:00
types.h
uaccess_32.h
uaccess_64.h sh: sh_ksyms_64 needs __strncpy_from_user() definition. 2008-09-29 19:45:16 +09:00
uaccess.h
ubc.h
ucontext.h
unaligned-sh4a.h sh: Provide optimized unaligned loads on SH-4A. 2008-12-22 18:43:48 +09:00
unaligned.h sh: Provide optimized unaligned loads on SH-4A. 2008-12-22 18:43:48 +09:00
unistd_32.h
unistd_64.h
unistd.h
user.h
vga.h
watchdog.h
xor.h