linux/arch/powerpc/include/uapi/asm
Eric B Munson b0f205c2a3 mm: mlock: add mlock flags to enable VM_LOCKONFAULT usage
The previous patch introduced a flag that specified pages in a VMA should
be placed on the unevictable LRU, but they should not be made present when
the area is created.  This patch adds the ability to set this state via
the new mlock system calls.

We add MLOCK_ONFAULT for mlock2 and MCL_ONFAULT for mlockall.
MLOCK_ONFAULT will set the VM_LOCKONFAULT modifier for VM_LOCKED.
MCL_ONFAULT should be used as a modifier to the two other mlockall flags.
When used with MCL_CURRENT, all current mappings will be marked with
VM_LOCKED | VM_LOCKONFAULT.  When used with MCL_FUTURE, the mm->def_flags
will be marked with VM_LOCKED | VM_LOCKONFAULT.  When used with both
MCL_CURRENT and MCL_FUTURE, all current mappings and mm->def_flags will be
marked with VM_LOCKED | VM_LOCKONFAULT.

Prior to this patch, mlockall() will unconditionally clear the
mm->def_flags any time it is called without MCL_FUTURE.  This behavior is
maintained after adding MCL_ONFAULT.  If a call to mlockall(MCL_FUTURE) is
followed by mlockall(MCL_CURRENT), the mm->def_flags will be cleared and
new VMAs will be unlocked.  This remains true with or without MCL_ONFAULT
in either mlockall() invocation.

munlock() will unconditionally clear both vma flags.  munlockall()
unconditionally clears for VMA flags on all VMAs and in the mm->def_flags
field.

Signed-off-by: Eric B Munson <emunson@akamai.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-05 19:34:48 -08:00
..
auxvec.h
bitsperlong.h
bootx.h
byteorder.h powerpc: Include the appropriate endianness header 2013-10-11 16:48:33 +11:00
cputable.h powerpc/tm: Abort syscalls in active transactions 2015-06-19 17:10:28 +10:00
eeh.h powerpc/eeh: Introduce eeh_pe_inject_err() 2015-05-12 20:33:35 +10:00
elf.h powerpc: Handle new ELFv2 module relocations 2014-04-23 10:05:29 +10:00
epapr_hcalls.h PPC: ePAPR: Convert hcall header to uapi (round 2) 2012-10-31 13:45:32 +01:00
errno.h powerpc/kernel: Switch to using MAX_ERRNO 2015-07-29 11:56:11 +10:00
fcntl.h
ioctl.h
ioctls.h tty, ioctls -- Add new ioctl definitions for tty flags fetching 2012-10-25 12:07:18 -07:00
ipcbuf.h
Kbuild powerpc: Export include/uapi/asm/eeh.h 2015-08-18 19:34:41 +10:00
kvm_para.h KVM: PPC: Disable NX for old magic page using guests 2014-05-30 14:26:24 +02:00
kvm.h KVM: PPC: Move ONE_REG AltiVec support to powerpc 2014-09-22 10:11:33 +02:00
mman.h mm: mlock: add mlock flags to enable VM_LOCKONFAULT usage 2015-11-05 19:34:48 -08:00
msgbuf.h
nvram.h
opal-prd.h powerpc/powernv: Add opal-prd channel 2015-06-05 08:32:21 +10:00
param.h
perf_event.h powerpc/perf: Export PERF_EVENT_CONFIG_EBB_SHIFT to userspace 2013-08-01 13:11:46 +10:00
poll.h
posix_types.h
ps3fb.h
ptrace.h powerpc: Change vrX register defines to vX to match gcc and glibc 2015-03-16 18:32:11 +11:00
resource.h
sembuf.h
setup.h powerpc: Bump COMMAND_LINE_SIZE to 2048 2014-04-28 16:31:58 +10:00
shmbuf.h
sigcontext.h powerpc/signal: Fix confusing header documentation in sigcontext.h 2015-07-16 16:14:40 +10:00
siginfo.h
signal.h powerpc: switch to generic old sigaction() 2013-02-03 18:16:10 -05:00
socket.h net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
sockios.h
spu_info.h
stat.h
statfs.h
swab.h
termbits.h
termios.h
tm.h powerpc/tm: Abort syscalls in active transactions 2015-06-19 17:10:28 +10:00
types.h
ucontext.h
unistd.h powerpc: Wire up sys_membarrier() 2015-09-21 17:27:08 +10:00