History

Merge branch 'akpm' (patches from Andrew)

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() ...

Linus Torvalds committed 9 years ago

Commit d34fc1a2 parents 1c9fe44 d2cd9ed139 files · +3960 −2068Browse files

Showing the changes to include/uapi/linux (4 of 139 files). Show all

Unified · Split

4 files
  1. include/uapi/linux/memfd.h +24 −0
  2. include/uapi/linux/mman.h +22 −0
  3. include/uapi/linux/shm.h +29 −2
  4. include/uapi/linux/userfaultfd.h +15 −1
include/uapi/linux/memfd.h+24−0
@@ -1,8 +1,32 @@
11 #ifndef _UAPI_LINUX_MEMFD_H
22 #define _UAPI_LINUX_MEMFD_H
33
4+#include <asm-generic/hugetlb_encode.h>
5+
46 /* flags for memfd_create(2) (unsigned int) */
57 #define MFD_CLOEXEC 0x0001U
68 #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
731
832 #endif /* _UAPI_LINUX_MEMFD_H */
include/uapi/linux/mman.h+22−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 #define _UAPI_LINUX_MMAN_H
33
44 #include <asm/mman.h>
5+#include <asm-generic/hugetlb_encode.h>
56
67 #define MREMAP_MAYMOVE 1
78 #define MREMAP_FIXED 2
@@ -10,4 +11,25 @@ · 2 unmodified lines
1011 #define OVERCOMMIT_ALWAYS 1
1112 #define OVERCOMMIT_NEVER 2
1213
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+
1335 #endif /* _UAPI_LINUX_MMAN_H */
include/uapi/linux/shm.h+29−2
@@ -3,6 +3,7 @@ · 2 unmodified lines
33
44 #include <linux/ipc.h>
55 #include <linux/errno.h>
6+#include <asm-generic/hugetlb_encode.h>
67 #ifndef __KERNEL__
78 #include <unistd.h>
89 #endif
@@ -40,11 +41,37 @@ struct shmid_ds { · 31 unmodified lines
4041 /* Include the definition of shmid64_ds and shminfo64 */
4142 #include <asm/shmbuf.h>
4243
43−/* permission flag for shmget */
44+/*
45+ * shmget() shmflg values.
46+ */
47+/* The bottom nine bits are the same as open(2) mode flags */
4448 #define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
4549 #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
4671
47−/* mode for attach */
72+/*
73+ * shmat() shmflg values
74+ */
4875 #define SHM_RDONLY 010000 /* read-only access */
4976 #define SHM_RND 020000 /* round attach address to SHMLBA boundary */
5077 #define SHM_REMAP 040000 /* take-over region on attach */
include/uapi/linux/userfaultfd.h+15−1
@@ -23,7 +23,9 @@ · 22 unmodified lines
2323 UFFD_FEATURE_EVENT_REMOVE | \
2424 UFFD_FEATURE_EVENT_UNMAP | \
2525 UFFD_FEATURE_MISSING_HUGETLBFS | \
26− UFFD_FEATURE_MISSING_SHMEM)
26+ UFFD_FEATURE_MISSING_SHMEM | \
27+ UFFD_FEATURE_SIGBUS | \
28+ UFFD_FEATURE_THREAD_ID)
2729 #define UFFD_API_IOCTLS \
2830 ((__u64)1 << _UFFDIO_REGISTER | \
2931 (__u64)1 << _UFFDIO_UNREGISTER | \
@@ -78,6 +80,9 @@ struct uffd_msg { · 48 unmodified lines
7880 struct {
7981 __u64 flags;
8082 __u64 address;
83+ union {
84+ __u32 ptid;
85+ } feat;
8186 } pagefault;
8287
8388 struct {
@@ -153,6 +158,13 @@ struct uffdio_api { · 69 unmodified lines
153158 * UFFD_FEATURE_MISSING_SHMEM works the same as
154159 * UFFD_FEATURE_MISSING_HUGETLBFS, but it applies to shmem
155160 * (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.
156168 */
157169 #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)
158170 #define UFFD_FEATURE_EVENT_FORK (1<<1)
@@ -161,6 +173,8 @@ struct uffdio_api { · 2 unmodified lines
161173 #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4)
162174 #define UFFD_FEATURE_MISSING_SHMEM (1<<5)
163175 #define UFFD_FEATURE_EVENT_UNMAP (1<<6)
176+#define UFFD_FEATURE_SIGBUS (1<<7)
177+#define UFFD_FEATURE_THREAD_ID (1<<8)
164178 __u64 features;
165179
166180 __u64 ioctls;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t