Merge updates from Andrew Morton: - various misc bits - DAX updates - OCFS2 - most of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (119 commits) mm,fork: introduce MADV_WIPEONFORK x86,mpx: make mpx depend on x86-64 to free up VMA flag mm: add /proc/pid/smaps_rollup mm: hugetlb: clear target sub-page last when clearing huge page mm: oom: let oom_reap_task and exit_mmap run concurrently swap: choose swap device according to numa node mm: replace TIF_MEMDIE checks by tsk_is_oom_victim mm, oom: do not rely on TIF_MEMDIE for memory reserves access z3fold: use per-cpu unbuddied lists mm, swap: don't use VMA based swap readahead if HDD is used as swap mm, swap: add sysfs interface for VMA based swap readahead mm, swap: VMA based swap readahead mm, swap: fix swap readahead marking mm, swap: add swap readahead hit statistics mm/vmalloc.c: don't reinvent the wheel but use existing llist API mm/vmstat.c: fix wrong comment selftests/memfd: add memfd_create hugetlbfs selftest mm/shmem: add hugetlbfs support to memfd_create() mm, devm_memremap_pages: use multi-order radix for ZONE_DEVICE lookups mm/vmalloc.c: halve the number of comparisons performed in pcpu_get_vm_areas() ...
Showing the changes to include/uapi/linux (4 of 139 files). Show all
Unified · Split
| @@ -1,8 +1,32 @@ | |||
| 1 | #ifndef _UAPI_LINUX_MEMFD_H | 1 | #ifndef _UAPI_LINUX_MEMFD_H |
| 2 | #define _UAPI_LINUX_MEMFD_H | 2 | #define _UAPI_LINUX_MEMFD_H |
| 3 | 3 | ||
| 4 | #include <asm-generic/hugetlb_encode.h> | ||
| 5 | |||
| 4 | /* flags for memfd_create(2) (unsigned int) */ | 6 | /* flags for memfd_create(2) (unsigned int) */ |
| 5 | #define MFD_CLOEXEC 0x0001U | 7 | #define MFD_CLOEXEC 0x0001U |
| 6 | #define MFD_ALLOW_SEALING 0x0002U | 8 | #define MFD_ALLOW_SEALING 0x0002U |
| 9 | #define MFD_HUGETLB 0x0004U | ||
| 10 | |||
| 11 | /* | ||
| 12 | * Huge page size encoding when MFD_HUGETLB is specified, and a huge page | ||
| 13 | * size other than the default is desired. See hugetlb_encode.h. | ||
| 14 | * All known huge page size encodings are provided here. It is the | ||
| 15 | * responsibility of the application to know which sizes are supported on | ||
| 16 | * the running system. See mmap(2) man page for details. | ||
| 17 | */ | ||
| 18 | #define MFD_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT | ||
| 19 | #define MFD_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK | ||
| 20 | |||
| 21 | #define MFD_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB | ||
| 22 | #define MFD_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB | ||
| 23 | #define MFD_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB | ||
| 24 | #define MFD_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB | ||
| 25 | #define MFD_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB | ||
| 26 | #define MFD_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB | ||
| 27 | #define MFD_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB | ||
| 28 | #define MFD_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB | ||
| 29 | #define MFD_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB | ||
| 30 | #define MFD_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB | ||
| 7 | 31 | ||
| 8 | #endif /* _UAPI_LINUX_MEMFD_H */ | 32 | #endif /* _UAPI_LINUX_MEMFD_H */ |
| @@ -2,6 +2,7 @@ · 1 unmodified line | |||
| 2 | #define _UAPI_LINUX_MMAN_H | 2 | #define _UAPI_LINUX_MMAN_H |
| 3 | 3 | ||
| 4 | #include <asm/mman.h> | 4 | #include <asm/mman.h> |
| 5 | #include <asm-generic/hugetlb_encode.h> | ||
| 5 | 6 | ||
| 6 | #define MREMAP_MAYMOVE 1 | 7 | #define MREMAP_MAYMOVE 1 |
| 7 | #define MREMAP_FIXED 2 | 8 | #define MREMAP_FIXED 2 |
| @@ -10,4 +11,25 @@ · 2 unmodified lines | |||
| 10 | #define OVERCOMMIT_ALWAYS 1 | 11 | #define OVERCOMMIT_ALWAYS 1 |
| 11 | #define OVERCOMMIT_NEVER 2 | 12 | #define OVERCOMMIT_NEVER 2 |
| 12 | 13 | ||
| 14 | /* | ||
| 15 | * Huge page size encoding when MAP_HUGETLB is specified, and a huge page | ||
| 16 | * size other than the default is desired. See hugetlb_encode.h. | ||
| 17 | * All known huge page size encodings are provided here. It is the | ||
| 18 | * responsibility of the application to know which sizes are supported on | ||
| 19 | * the running system. See mmap(2) man page for details. | ||
| 20 | */ | ||
| 21 | #define MAP_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT | ||
| 22 | #define MAP_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK | ||
| 23 | |||
| 24 | #define MAP_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB | ||
| 25 | #define MAP_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB | ||
| 26 | #define MAP_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB | ||
| 27 | #define MAP_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB | ||
| 28 | #define MAP_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB | ||
| 29 | #define MAP_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB | ||
| 30 | #define MAP_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB | ||
| 31 | #define MAP_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB | ||
| 32 | #define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB | ||
| 33 | #define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB | ||
| 34 | |||
| 13 | #endif /* _UAPI_LINUX_MMAN_H */ | 35 | #endif /* _UAPI_LINUX_MMAN_H */ |
| @@ -3,6 +3,7 @@ · 2 unmodified lines | |||
| 3 | 3 | ||
| 4 | #include <linux/ipc.h> | 4 | #include <linux/ipc.h> |
| 5 | #include <linux/errno.h> | 5 | #include <linux/errno.h> |
| 6 | #include <asm-generic/hugetlb_encode.h> | ||
| 6 | #ifndef __KERNEL__ | 7 | #ifndef __KERNEL__ |
| 7 | #include <unistd.h> | 8 | #include <unistd.h> |
| 8 | #endif | 9 | #endif |
| @@ -40,11 +41,37 @@ struct shmid_ds { · 31 unmodified lines | |||
| 40 | /* Include the definition of shmid64_ds and shminfo64 */ | 41 | /* Include the definition of shmid64_ds and shminfo64 */ |
| 41 | #include <asm/shmbuf.h> | 42 | #include <asm/shmbuf.h> |
| 42 | 43 | ||
| 43 | /* permission flag for shmget */ | 44 | /* |
| 45 | * shmget() shmflg values. | ||
| 46 | */ | ||
| 47 | /* The bottom nine bits are the same as open(2) mode flags */ | ||
| 44 | #define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ | 48 | #define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ |
| 45 | #define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ | 49 | #define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ |
| 50 | /* Bits 9 & 10 are IPC_CREAT and IPC_EXCL */ | ||
| 51 | #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ | ||
| 52 | #define SHM_NORESERVE 010000 /* don't check for reservations */ | ||
| 53 | |||
| 54 | /* | ||
| 55 | * Huge page size encoding when SHM_HUGETLB is specified, and a huge page | ||
| 56 | * size other than the default is desired. See hugetlb_encode.h | ||
| 57 | */ | ||
| 58 | #define SHM_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT | ||
| 59 | #define SHM_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK | ||
| 60 | |||
| 61 | #define SHM_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB | ||
| 62 | #define SHM_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB | ||
| 63 | #define SHM_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB | ||
| 64 | #define SHM_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB | ||
| 65 | #define SHM_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB | ||
| 66 | #define SHM_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB | ||
| 67 | #define SHM_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB | ||
| 68 | #define SHM_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB | ||
| 69 | #define SHM_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB | ||
| 70 | #define SHM_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB | ||
| 46 | 71 | ||
| 47 | /* mode for attach */ | 72 | /* |
| 73 | * shmat() shmflg values | ||
| 74 | */ | ||
| 48 | #define SHM_RDONLY 010000 /* read-only access */ | 75 | #define SHM_RDONLY 010000 /* read-only access */ |
| 49 | #define SHM_RND 020000 /* round attach address to SHMLBA boundary */ | 76 | #define SHM_RND 020000 /* round attach address to SHMLBA boundary */ |
| 50 | #define SHM_REMAP 040000 /* take-over region on attach */ | 77 | #define SHM_REMAP 040000 /* take-over region on attach */ |
| @@ -23,7 +23,9 @@ · 22 unmodified lines | |||
| 23 | UFFD_FEATURE_EVENT_REMOVE | \ | 23 | UFFD_FEATURE_EVENT_REMOVE | \ |
| 24 | UFFD_FEATURE_EVENT_UNMAP | \ | 24 | UFFD_FEATURE_EVENT_UNMAP | \ |
| 25 | UFFD_FEATURE_MISSING_HUGETLBFS | \ | 25 | UFFD_FEATURE_MISSING_HUGETLBFS | \ |
| 26 | UFFD_FEATURE_MISSING_SHMEM) | 26 | UFFD_FEATURE_MISSING_SHMEM | \ |
| 27 | UFFD_FEATURE_SIGBUS | \ | ||
| 28 | UFFD_FEATURE_THREAD_ID) | ||
| 27 | #define UFFD_API_IOCTLS \ | 29 | #define UFFD_API_IOCTLS \ |
| 28 | ((__u64)1 << _UFFDIO_REGISTER | \ | 30 | ((__u64)1 << _UFFDIO_REGISTER | \ |
| 29 | (__u64)1 << _UFFDIO_UNREGISTER | \ | 31 | (__u64)1 << _UFFDIO_UNREGISTER | \ |
| @@ -78,6 +80,9 @@ struct uffd_msg { · 48 unmodified lines | |||
| 78 | struct { | 80 | struct { |
| 79 | __u64 flags; | 81 | __u64 flags; |
| 80 | __u64 address; | 82 | __u64 address; |
| 83 | union { | ||
| 84 | __u32 ptid; | ||
| 85 | } feat; | ||
| 81 | } pagefault; | 86 | } pagefault; |
| 82 | 87 | ||
| 83 | struct { | 88 | struct { |
| @@ -153,6 +158,13 @@ struct uffdio_api { · 69 unmodified lines | |||
| 153 | * UFFD_FEATURE_MISSING_SHMEM works the same as | 158 | * UFFD_FEATURE_MISSING_SHMEM works the same as |
| 154 | * UFFD_FEATURE_MISSING_HUGETLBFS, but it applies to shmem | 159 | * UFFD_FEATURE_MISSING_HUGETLBFS, but it applies to shmem |
| 155 | * (i.e. tmpfs and other shmem based APIs). | 160 | * (i.e. tmpfs and other shmem based APIs). |
| 161 | * | ||
| 162 | * UFFD_FEATURE_SIGBUS feature means no page-fault | ||
| 163 | * (UFFD_EVENT_PAGEFAULT) event will be delivered, instead | ||
| 164 | * a SIGBUS signal will be sent to the faulting process. | ||
| 165 | * | ||
| 166 | * UFFD_FEATURE_THREAD_ID pid of the page faulted task_struct will | ||
| 167 | * be returned, if feature is not requested 0 will be returned. | ||
| 156 | */ | 168 | */ |
| 157 | #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) | 169 | #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) |
| 158 | #define UFFD_FEATURE_EVENT_FORK (1<<1) | 170 | #define UFFD_FEATURE_EVENT_FORK (1<<1) |
| @@ -161,6 +173,8 @@ struct uffdio_api { · 2 unmodified lines | |||
| 161 | #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) | 173 | #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) |
| 162 | #define UFFD_FEATURE_MISSING_SHMEM (1<<5) | 174 | #define UFFD_FEATURE_MISSING_SHMEM (1<<5) |
| 163 | #define UFFD_FEATURE_EVENT_UNMAP (1<<6) | 175 | #define UFFD_FEATURE_EVENT_UNMAP (1<<6) |
| 176 | #define UFFD_FEATURE_SIGBUS (1<<7) | ||
| 177 | #define UFFD_FEATURE_THREAD_ID (1<<8) | ||
| 164 | __u64 features; | 178 | __u64 features; |
| 165 | 179 | ||
| 166 | __u64 ioctls; | 180 | __u64 ioctls; |