linux/arch/ia64/kernel
Konstantin Khlebnikov 8463833590 mm: rework virtual memory accounting
When inspecting a vague code inside prctl(PR_SET_MM_MEM) call (which
testing the RLIMIT_DATA value to figure out if we're allowed to assign
new @start_brk, @brk, @start_data, @end_data from mm_struct) it's been
commited that RLIMIT_DATA in a form it's implemented now doesn't do
anything useful because most of user-space libraries use mmap() syscall
for dynamic memory allocations.

Linus suggested to convert RLIMIT_DATA rlimit into something suitable
for anonymous memory accounting.  But in this patch we go further, and
the changes are bundled together as:

 * keep vma counting if CONFIG_PROC_FS=n, will be used for limits
 * replace mm->shared_vm with better defined mm->data_vm
 * account anonymous executable areas as executable
 * account file-backed growsdown/up areas as stack
 * drop struct file* argument from vm_stat_account
 * enforce RLIMIT_DATA for size of data areas

This way code looks cleaner: now code/stack/data classification depends
only on vm_flags state:

 VM_EXEC & ~VM_WRITE            -> code  (VmExe + VmLib in proc)
 VM_GROWSUP | VM_GROWSDOWN      -> stack (VmStk)
 VM_WRITE & ~VM_SHARED & !stack -> data  (VmData)

The rest (VmSize - VmData - VmStk - VmExe - VmLib) could be called
"shared", but that might be strange beast like readonly-private or VM_IO
area.

 - RLIMIT_AS            limits whole address space "VmSize"
 - RLIMIT_STACK         limits stack "VmStk" (but each vma individually)
 - RLIMIT_DATA          now limits "VmData"

Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Kees Cook <keescook@google.com>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-14 16:00:49 -08:00
..
.gitignore
acpi-ext.c ACPICA: Resources: Provide common part for struct acpi_resource_address structures. 2015-01-26 16:09:56 +01:00
acpi.c Initial ACPI support for arm64: 2015-04-24 08:23:45 -07:00
asm-offsets.c ia64/xen: Remove Xen support for ia64 2013-12-10 16:11:07 -08:00
audit.c [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
brl_emu.c
crash.c ia64: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:15 -07:00
crash_dump.c crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr_addr, setup_elfcorehdr and saved_max_pfn 2011-03-23 19:47:19 -07:00
cyclone.c arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead 2015-08-10 23:07:05 -04:00
dma-mapping.c ia64: Add export.h to arch/ia64 specific files as required 2011-10-31 19:30:58 -04:00
efi.c The libnvdimm sub-system introduces, in addition to the libnvdimm-core, 2015-06-29 10:34:42 -07:00
efi_stub.S
elfcore.c switch elf_core_write_extra_data() to dump_emit() 2013-11-09 00:16:23 -05:00
entry.h
entry.S [IA64] Enable mlock2 syscall for ia64 2015-12-14 10:30:02 -08:00
err_inject.c ia64, err-inject: Fix CPU hotplug callback registration 2014-03-20 13:43:41 +01:00
esi.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
esi_stub.S
fsys.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
fsyscall_gtod_data.h ia64: vsyscall: Use seqcount instead of seqlock 2012-03-15 18:17:59 -07:00
ftrace.c ia64: ftrace: Fix the comments for ftrace_modify_code() 2015-12-23 14:27:23 -05:00
gate-data.S Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
gate.lds.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
gate.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
head.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
ia64_ksyms.c ia64: export flush_icache_range for module use 2015-06-15 14:58:24 -07:00
init_task.c Rename .data.init_task to .data..init_task. 2010-03-03 11:25:58 +01:00
iosapic.c ia64/iosapic: Use irq_set_chip_handler_name_locked() 2015-07-27 13:36:37 +02:00
irq.c ia64/irq: Use access helper irq_data_get_affinity_mask() 2015-07-27 13:36:37 +02:00
irq_ia64.c ia64: remove deprecated cpus_ usage. 2015-03-10 13:54:38 +10:30
irq_lsapic.c ia64: Convert lsapic to new irq_chip functions 2011-03-29 14:48:02 +02:00
ivt.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
jprobes.S
kprobes.c ia64: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
machine_kexec.c ia64: expose number of page table levels on Kconfig level 2015-04-14 16:49:02 -07:00
machvec.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
Makefile ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
Makefile.gate Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
mca.c ia64: Use setup_timer 2015-06-15 15:45:18 -07:00
mca_asm.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
mca_drv.c Remove cast for kmalloc return value 2013-03-19 16:14:53 -07:00
mca_drv.h
mca_drv_asm.S
minstate.h ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
module.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
msi_ia64.c ia64/irq: Use access helper irq_data_get_affinity_mask() 2015-07-27 13:36:37 +02:00
nr-irqs.c ia64/xen: Remove Xen support for ia64 2013-12-10 16:11:07 -08:00
numa.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
pal.S
palinfo.c ia64, palinfo: Fix CPU hotplug callback registration 2014-03-20 13:43:40 +01:00
patch.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
pci-dma.c [IA64] pci: Remove unused fallback_dev 2013-06-03 16:04:31 -07:00
pci-swiotlb.c X86 & IA64: adapt for dma_map_ops changes 2012-03-28 16:36:31 +02:00
perfmon.c mm: rework virtual memory accounting 2016-01-14 16:00:49 -08:00
perfmon_default_smpl.c Fix common misspellings 2011-03-31 11:26:23 -03:00
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
process.c ia64: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
ptrace.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
relocate_kernel.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
sal.c
salinfo.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
setup.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
sigframe.h
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
smp.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
smpboot.c Nobody cares about paravirtualization on ia64 anymore 2015-06-22 20:33:38 -07:00
stacktrace.c [IA64] Add CONFIG_STACKTRACE_SUPPORT 2010-09-23 13:52:07 -07:00
sys_ia64.c mm: use vm_unmapped_area() on ia64 architecture 2013-02-22 13:46:59 -08:00
time.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
topology.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
traps.c ia64: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
unaligned.c [IA64] use __ratelimit 2010-05-18 14:45:54 -07:00
uncached.c mm: rename alloc_pages_exact_node() to __alloc_pages_node() 2015-09-08 15:35:28 -07:00
unwind.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
unwind_decoder.c
unwind_i.h
vmlinux.lds.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00