diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 16:00:36 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 16:00:36 -0500 |
| commit | 78a45c6f067824cf5d0a9fedea7339ac2e28603c (patch) | |
| tree | b4f78c8b6b9059ddace0a18c11629b8d2045f793 /include/linux | |
| parent | f96fe225677b3efb74346ebd56fafe3997b02afa (diff) | |
| parent | 29d293b6007b91a4463f05bc8d0b26e0e65c5816 (diff) | |
Merge branch 'akpm' (second patch-bomb from Andrew)
Merge second patchbomb from Andrew Morton:
- the rest of MM
- misc fs fixes
- add execveat() syscall
- new ratelimit feature for fault-injection
- decompressor updates
- ipc/ updates
- fallocate feature creep
- fsnotify cleanups
- a few other misc things
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (99 commits)
cgroups: Documentation: fix trivial typos and wrong paragraph numberings
parisc: percpu: update comments referring to __get_cpu_var
percpu: update local_ops.txt to reflect this_cpu operations
percpu: remove __get_cpu_var and __raw_get_cpu_var macros
fsnotify: remove destroy_list from fsnotify_mark
fsnotify: unify inode and mount marks handling
fallocate: create FAN_MODIFY and IN_MODIFY events
mm/cma: make kmemleak ignore CMA regions
slub: fix cpuset check in get_any_partial
slab: fix cpuset check in fallback_alloc
shmdt: use i_size_read() instead of ->i_size
ipc/shm.c: fix overly aggressive shmdt() when calls span multiple segments
ipc/msg: increase MSGMNI, remove scaling
ipc/sem.c: increase SEMMSL, SEMMNI, SEMOPM
ipc/sem.c: change memory barrier in sem_lock() to smp_rmb()
lib/decompress.c: consistency of compress formats for kernel image
decompress_bunzip2: off by one in get_next_block()
usr/Kconfig: make initrd compression algorithm selection not expert
fault-inject: add ratelimit option
ratelimit: add initialization macro
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/binfmts.h | 4 | ||||
| -rw-r--r-- | include/linux/bitmap.h | 36 | ||||
| -rw-r--r-- | include/linux/compat.h | 3 | ||||
| -rw-r--r-- | include/linux/fault-inject.h | 17 | ||||
| -rw-r--r-- | include/linux/fs.h | 24 | ||||
| -rw-r--r-- | include/linux/fsnotify_backend.h | 31 | ||||
| -rw-r--r-- | include/linux/gfp.h | 7 | ||||
| -rw-r--r-- | include/linux/ipc_namespace.h | 20 | ||||
| -rw-r--r-- | include/linux/kmemleak.h | 2 | ||||
| -rw-r--r-- | include/linux/memcontrol.h | 16 | ||||
| -rw-r--r-- | include/linux/mm.h | 42 | ||||
| -rw-r--r-- | include/linux/mm_types.h | 12 | ||||
| -rw-r--r-- | include/linux/mmu_notifier.h | 2 | ||||
| -rw-r--r-- | include/linux/mmzone.h | 12 | ||||
| -rw-r--r-- | include/linux/oom.h | 11 | ||||
| -rw-r--r-- | include/linux/page-debug-flags.h | 32 | ||||
| -rw-r--r-- | include/linux/page_ext.h | 84 | ||||
| -rw-r--r-- | include/linux/page_owner.h | 38 | ||||
| -rw-r--r-- | include/linux/percpu-defs.h | 2 | ||||
| -rw-r--r-- | include/linux/ratelimit.h | 12 | ||||
| -rw-r--r-- | include/linux/sched.h | 11 | ||||
| -rw-r--r-- | include/linux/shrinker.h | 2 | ||||
| -rw-r--r-- | include/linux/slab.h | 2 | ||||
| -rw-r--r-- | include/linux/stacktrace.h | 5 | ||||
| -rw-r--r-- | include/linux/swap.h | 8 | ||||
| -rw-r--r-- | include/linux/syscalls.h | 5 | ||||
| -rw-r--r-- | include/linux/vm_event_item.h | 1 |
27 files changed, 318 insertions, 123 deletions
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 61f29e5ea840..576e4639ca60 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -53,6 +53,10 @@ struct linux_binprm { | |||
| 53 | #define BINPRM_FLAGS_EXECFD_BIT 1 | 53 | #define BINPRM_FLAGS_EXECFD_BIT 1 |
| 54 | #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) | 54 | #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) |
| 55 | 55 | ||
| 56 | /* filename of the binary will be inaccessible after exec */ | ||
| 57 | #define BINPRM_FLAGS_PATH_INACCESSIBLE_BIT 2 | ||
| 58 | #define BINPRM_FLAGS_PATH_INACCESSIBLE (1 << BINPRM_FLAGS_PATH_INACCESSIBLE_BIT) | ||
| 59 | |||
| 56 | /* Function parameter for binfmt->coredump */ | 60 | /* Function parameter for binfmt->coredump */ |
| 57 | struct coredump_params { | 61 | struct coredump_params { |
| 58 | const siginfo_t *siginfo; | 62 | const siginfo_t *siginfo; |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index e1c8d080c427..34e020c23644 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
| @@ -45,6 +45,7 @@ | |||
| 45 | * bitmap_set(dst, pos, nbits) Set specified bit area | 45 | * bitmap_set(dst, pos, nbits) Set specified bit area |
| 46 | * bitmap_clear(dst, pos, nbits) Clear specified bit area | 46 | * bitmap_clear(dst, pos, nbits) Clear specified bit area |
| 47 | * bitmap_find_next_zero_area(buf, len, pos, n, mask) Find bit free area | 47 | * bitmap_find_next_zero_area(buf, len, pos, n, mask) Find bit free area |
| 48 | * bitmap_find_next_zero_area_off(buf, len, pos, n, mask) as above | ||
| 48 | * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n | 49 | * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n |
| 49 | * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n | 50 | * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n |
| 50 | * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) | 51 | * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) |
| @@ -114,11 +115,36 @@ extern int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits); | |||
| 114 | 115 | ||
| 115 | extern void bitmap_set(unsigned long *map, unsigned int start, int len); | 116 | extern void bitmap_set(unsigned long *map, unsigned int start, int len); |
| 116 | extern void bitmap_clear(unsigned long *map, unsigned int start, int len); | 117 | extern void bitmap_clear(unsigned long *map, unsigned int start, int len); |
| 117 | extern unsigned long bitmap_find_next_zero_area(unsigned long *map, | 118 | |
| 118 | unsigned long size, | 119 | extern unsigned long bitmap_find_next_zero_area_off(unsigned long *map, |
| 119 | unsigned long start, | 120 | unsigned long size, |
| 120 | unsigned int nr, | 121 | unsigned long start, |
| 121 | unsigned long align_mask); | 122 | unsigned int nr, |
| 123 | unsigned long align_mask, | ||
| 124 | unsigned long align_offset); | ||
| 125 | |||
| 126 | /** | ||
| 127 | * bitmap_find_next_zero_area - find a contiguous aligned zero area | ||
| 128 | * @map: The address to base the search on | ||
| 129 | * @size: The bitmap size in bits | ||
| 130 | * @start: The bitnumber to start searching at | ||
| 131 | * @nr: The number of zeroed bits we're looking for | ||
| 132 | * @align_mask: Alignment mask for zero area | ||
| 133 | * | ||
| 134 | * The @align_mask should be one less than a power of 2; the effect is that | ||
| 135 | * the bit offset of all zero areas this function finds is multiples of that | ||
| 136 | * power of 2. A @align_mask of 0 means no alignment is required. | ||
| 137 | */ | ||
| 138 | static inline unsigned long | ||
| 139 | bitmap_find_next_zero_area(unsigned long *map, | ||
| 140 | unsigned long size, | ||
| 141 | unsigned long start, | ||
| 142 | unsigned int nr, | ||
| 143 | unsigned long align_mask) | ||
| 144 | { | ||
| 145 | return bitmap_find_next_zero_area_off(map, size, start, nr, | ||
| 146 | align_mask, 0); | ||
| 147 | } | ||
| 122 | 148 | ||
| 123 | extern int bitmap_scnprintf(char *buf, unsigned int len, | 149 | extern int bitmap_scnprintf(char *buf, unsigned int len, |
| 124 | const unsigned long *src, int nbits); | 150 | const unsigned long *src, int nbits); |
diff --git a/include/linux/compat.h b/include/linux/compat.h index e6494261eaff..7450ca2ac1fc 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -357,6 +357,9 @@ asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int); | |||
| 357 | 357 | ||
| 358 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, | 358 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, |
| 359 | const compat_uptr_t __user *envp); | 359 | const compat_uptr_t __user *envp); |
| 360 | asmlinkage long compat_sys_execveat(int dfd, const char __user *filename, | ||
| 361 | const compat_uptr_t __user *argv, | ||
| 362 | const compat_uptr_t __user *envp, int flags); | ||
| 360 | 363 | ||
| 361 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | 364 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, |
| 362 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 365 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h index c6f996f2abb6..798fad9e420d 100644 --- a/include/linux/fault-inject.h +++ b/include/linux/fault-inject.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 7 | #include <linux/debugfs.h> | 7 | #include <linux/debugfs.h> |
| 8 | #include <linux/ratelimit.h> | ||
| 8 | #include <linux/atomic.h> | 9 | #include <linux/atomic.h> |
| 9 | 10 | ||
| 10 | /* | 11 | /* |
| @@ -25,14 +26,18 @@ struct fault_attr { | |||
| 25 | unsigned long reject_end; | 26 | unsigned long reject_end; |
| 26 | 27 | ||
| 27 | unsigned long count; | 28 | unsigned long count; |
| 29 | struct ratelimit_state ratelimit_state; | ||
| 30 | struct dentry *dname; | ||
| 28 | }; | 31 | }; |
| 29 | 32 | ||
| 30 | #define FAULT_ATTR_INITIALIZER { \ | 33 | #define FAULT_ATTR_INITIALIZER { \ |
| 31 | .interval = 1, \ | 34 | .interval = 1, \ |
| 32 | .times = ATOMIC_INIT(1), \ | 35 | .times = ATOMIC_INIT(1), \ |
| 33 | .require_end = ULONG_MAX, \ | 36 | .require_end = ULONG_MAX, \ |
| 34 | .stacktrace_depth = 32, \ | 37 | .stacktrace_depth = 32, \ |
| 35 | .verbose = 2, \ | 38 | .ratelimit_state = RATELIMIT_STATE_INIT_DISABLED, \ |
| 39 | .verbose = 2, \ | ||
| 40 | .dname = NULL, \ | ||
| 36 | } | 41 | } |
| 37 | 42 | ||
| 38 | #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER | 43 | #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER |
diff --git a/include/linux/fs.h b/include/linux/fs.h index bb29b02d9bb6..4193a0bd99b0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/pid.h> | 18 | #include <linux/pid.h> |
| 19 | #include <linux/bug.h> | 19 | #include <linux/bug.h> |
| 20 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
| 21 | #include <linux/rwsem.h> | ||
| 21 | #include <linux/capability.h> | 22 | #include <linux/capability.h> |
| 22 | #include <linux/semaphore.h> | 23 | #include <linux/semaphore.h> |
| 23 | #include <linux/fiemap.h> | 24 | #include <linux/fiemap.h> |
| @@ -401,7 +402,7 @@ struct address_space { | |||
| 401 | atomic_t i_mmap_writable;/* count VM_SHARED mappings */ | 402 | atomic_t i_mmap_writable;/* count VM_SHARED mappings */ |
| 402 | struct rb_root i_mmap; /* tree of private and shared mappings */ | 403 | struct rb_root i_mmap; /* tree of private and shared mappings */ |
| 403 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ | 404 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ |
| 404 | struct mutex i_mmap_mutex; /* protect tree, count, list */ | 405 | struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */ |
| 405 | /* Protected by tree_lock together with the radix tree */ | 406 | /* Protected by tree_lock together with the radix tree */ |
| 406 | unsigned long nrpages; /* number of total pages */ | 407 | unsigned long nrpages; /* number of total pages */ |
| 407 | unsigned long nrshadows; /* number of shadow entries */ | 408 | unsigned long nrshadows; /* number of shadow entries */ |
| @@ -467,6 +468,26 @@ struct block_device { | |||
| 467 | 468 | ||
| 468 | int mapping_tagged(struct address_space *mapping, int tag); | 469 | int mapping_tagged(struct address_space *mapping, int tag); |
| 469 | 470 | ||
| 471 | static inline void i_mmap_lock_write(struct address_space *mapping) | ||
| 472 | { | ||
| 473 | down_write(&mapping->i_mmap_rwsem); | ||
| 474 | } | ||
| 475 | |||
| 476 | static inline void i_mmap_unlock_write(struct address_space *mapping) | ||
| 477 | { | ||
| 478 | up_write(&mapping->i_mmap_rwsem); | ||
| 479 | } | ||
| 480 | |||
| 481 | static inline void i_mmap_lock_read(struct address_space *mapping) | ||
| 482 | { | ||
| 483 | down_read(&mapping->i_mmap_rwsem); | ||
| 484 | } | ||
| 485 | |||
| 486 | static inline void i_mmap_unlock_read(struct address_space *mapping) | ||
| 487 | { | ||
| 488 | up_read(&mapping->i_mmap_rwsem); | ||
| 489 | } | ||
| 490 | |||
| 470 | /* | 491 | /* |
| 471 | * Might pages of this file be mapped into userspace? | 492 | * Might pages of this file be mapped into userspace? |
| 472 | */ | 493 | */ |
| @@ -2075,6 +2096,7 @@ extern int vfs_open(const struct path *, struct file *, const struct cred *); | |||
| 2075 | extern struct file * dentry_open(const struct path *, int, const struct cred *); | 2096 | extern struct file * dentry_open(const struct path *, int, const struct cred *); |
| 2076 | extern int filp_close(struct file *, fl_owner_t id); | 2097 | extern int filp_close(struct file *, fl_owner_t id); |
| 2077 | 2098 | ||
| 2099 | extern struct filename *getname_flags(const char __user *, int, int *); | ||
| 2078 | extern struct filename *getname(const char __user *); | 2100 | extern struct filename *getname(const char __user *); |
| 2079 | extern struct filename *getname_kernel(const char *); | 2101 | extern struct filename *getname_kernel(const char *); |
| 2080 | 2102 | ||
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index ca060d7c4fa6..0f313f93c586 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
| @@ -197,24 +197,6 @@ struct fsnotify_group { | |||
| 197 | #define FSNOTIFY_EVENT_INODE 2 | 197 | #define FSNOTIFY_EVENT_INODE 2 |
| 198 | 198 | ||
| 199 | /* | 199 | /* |
| 200 | * Inode specific fields in an fsnotify_mark | ||
| 201 | */ | ||
| 202 | struct fsnotify_inode_mark { | ||
| 203 | struct inode *inode; /* inode this mark is associated with */ | ||
| 204 | struct hlist_node i_list; /* list of marks by inode->i_fsnotify_marks */ | ||
| 205 | struct list_head free_i_list; /* tmp list used when freeing this mark */ | ||
| 206 | }; | ||
| 207 | |||
| 208 | /* | ||
| 209 | * Mount point specific fields in an fsnotify_mark | ||
| 210 | */ | ||
| 211 | struct fsnotify_vfsmount_mark { | ||
| 212 | struct vfsmount *mnt; /* vfsmount this mark is associated with */ | ||
| 213 | struct hlist_node m_list; /* list of marks by inode->i_fsnotify_marks */ | ||
| 214 | struct list_head free_m_list; /* tmp list used when freeing this mark */ | ||
| 215 | }; | ||
| 216 | |||
| 217 | /* | ||
| 218 | * a mark is simply an object attached to an in core inode which allows an | 200 | * a mark is simply an object attached to an in core inode which allows an |
| 219 | * fsnotify listener to indicate they are either no longer interested in events | 201 | * fsnotify listener to indicate they are either no longer interested in events |
| 220 | * of a type matching mask or only interested in those events. | 202 | * of a type matching mask or only interested in those events. |
| @@ -230,11 +212,17 @@ struct fsnotify_mark { | |||
| 230 | * in kernel that found and may be using this mark. */ | 212 | * in kernel that found and may be using this mark. */ |
| 231 | atomic_t refcnt; /* active things looking at this mark */ | 213 | atomic_t refcnt; /* active things looking at this mark */ |
| 232 | struct fsnotify_group *group; /* group this mark is for */ | 214 | struct fsnotify_group *group; /* group this mark is for */ |
| 233 | struct list_head g_list; /* list of marks by group->i_fsnotify_marks */ | 215 | struct list_head g_list; /* list of marks by group->i_fsnotify_marks |
| 216 | * Also reused for queueing mark into | ||
| 217 | * destroy_list when it's waiting for | ||
| 218 | * the end of SRCU period before it can | ||
| 219 | * be freed */ | ||
| 234 | spinlock_t lock; /* protect group and inode */ | 220 | spinlock_t lock; /* protect group and inode */ |
| 221 | struct hlist_node obj_list; /* list of marks for inode / vfsmount */ | ||
| 222 | struct list_head free_list; /* tmp list used when freeing this mark */ | ||
| 235 | union { | 223 | union { |
| 236 | struct fsnotify_inode_mark i; | 224 | struct inode *inode; /* inode this mark is associated with */ |
| 237 | struct fsnotify_vfsmount_mark m; | 225 | struct vfsmount *mnt; /* vfsmount this mark is associated with */ |
| 238 | }; | 226 | }; |
| 239 | __u32 ignored_mask; /* events types to ignore */ | 227 | __u32 ignored_mask; /* events types to ignore */ |
| 240 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 | 228 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 |
| @@ -243,7 +231,6 @@ struct fsnotify_mark { | |||
| 243 | #define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08 | 231 | #define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08 |
| 244 | #define FSNOTIFY_MARK_FLAG_ALIVE 0x10 | 232 | #define FSNOTIFY_MARK_FLAG_ALIVE 0x10 |
| 245 | unsigned int flags; /* vfsmount or inode mark? */ | 233 | unsigned int flags; /* vfsmount or inode mark? */ |
| 246 | struct list_head destroy_list; | ||
| 247 | void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */ | 234 | void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */ |
| 248 | }; | 235 | }; |
| 249 | 236 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 07d2699cdb51..b840e3b2770d 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -110,11 +110,8 @@ struct vm_area_struct; | |||
| 110 | #define GFP_TEMPORARY (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | 110 | #define GFP_TEMPORARY (__GFP_WAIT | __GFP_IO | __GFP_FS | \ |
| 111 | __GFP_RECLAIMABLE) | 111 | __GFP_RECLAIMABLE) |
| 112 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) | 112 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) |
| 113 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ | 113 | #define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM) |
| 114 | __GFP_HIGHMEM) | 114 | #define GFP_HIGHUSER_MOVABLE (GFP_HIGHUSER | __GFP_MOVABLE) |
| 115 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
| 116 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | ||
| 117 | __GFP_MOVABLE) | ||
| 118 | #define GFP_IOFS (__GFP_IO | __GFP_FS) | 115 | #define GFP_IOFS (__GFP_IO | __GFP_FS) |
| 119 | #define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ | 116 | #define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ |
| 120 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ | 117 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 35e7eca4e33b..e365d5ec69cb 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
| @@ -7,15 +7,6 @@ | |||
| 7 | #include <linux/notifier.h> | 7 | #include <linux/notifier.h> |
| 8 | #include <linux/nsproxy.h> | 8 | #include <linux/nsproxy.h> |
| 9 | 9 | ||
| 10 | /* | ||
| 11 | * ipc namespace events | ||
| 12 | */ | ||
| 13 | #define IPCNS_MEMCHANGED 0x00000001 /* Notify lowmem size changed */ | ||
| 14 | #define IPCNS_CREATED 0x00000002 /* Notify new ipc namespace created */ | ||
| 15 | #define IPCNS_REMOVED 0x00000003 /* Notify ipc namespace removed */ | ||
| 16 | |||
| 17 | #define IPCNS_CALLBACK_PRI 0 | ||
| 18 | |||
| 19 | struct user_namespace; | 10 | struct user_namespace; |
| 20 | 11 | ||
| 21 | struct ipc_ids { | 12 | struct ipc_ids { |
| @@ -38,7 +29,6 @@ struct ipc_namespace { | |||
| 38 | unsigned int msg_ctlmni; | 29 | unsigned int msg_ctlmni; |
| 39 | atomic_t msg_bytes; | 30 | atomic_t msg_bytes; |
| 40 | atomic_t msg_hdrs; | 31 | atomic_t msg_hdrs; |
| 41 | int auto_msgmni; | ||
| 42 | 32 | ||
| 43 | size_t shm_ctlmax; | 33 | size_t shm_ctlmax; |
| 44 | size_t shm_ctlall; | 34 | size_t shm_ctlall; |
| @@ -77,18 +67,8 @@ extern atomic_t nr_ipc_ns; | |||
| 77 | extern spinlock_t mq_lock; | 67 | extern spinlock_t mq_lock; |
| 78 | 68 | ||
| 79 | #ifdef CONFIG_SYSVIPC | 69 | #ifdef CONFIG_SYSVIPC |
| 80 | extern int register_ipcns_notifier(struct ipc_namespace *); | ||
| 81 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); | ||
| 82 | extern void unregister_ipcns_notifier(struct ipc_namespace *); | ||
| 83 | extern int ipcns_notify(unsigned long); | ||
| 84 | extern void shm_destroy_orphaned(struct ipc_namespace *ns); | 70 | extern void shm_destroy_orphaned(struct ipc_namespace *ns); |
| 85 | #else /* CONFIG_SYSVIPC */ | 71 | #else /* CONFIG_SYSVIPC */ |
| 86 | static inline int register_ipcns_notifier(struct ipc_namespace *ns) | ||
| 87 | { return 0; } | ||
| 88 | static inline int cond_register_ipcns_notifier(struct ipc_namespace *ns) | ||
| 89 | { return 0; } | ||
| 90 | static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { } | ||
| 91 | static inline int ipcns_notify(unsigned long l) { return 0; } | ||
| 92 | static inline void shm_destroy_orphaned(struct ipc_namespace *ns) {} | 72 | static inline void shm_destroy_orphaned(struct ipc_namespace *ns) {} |
| 93 | #endif /* CONFIG_SYSVIPC */ | 73 | #endif /* CONFIG_SYSVIPC */ |
| 94 | 74 | ||
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h index 057e95971014..e705467ddb47 100644 --- a/include/linux/kmemleak.h +++ b/include/linux/kmemleak.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | #ifndef __KMEMLEAK_H | 21 | #ifndef __KMEMLEAK_H |
| 22 | #define __KMEMLEAK_H | 22 | #define __KMEMLEAK_H |
| 23 | 23 | ||
| 24 | #include <linux/slab.h> | ||
| 25 | |||
| 24 | #ifdef CONFIG_DEBUG_KMEMLEAK | 26 | #ifdef CONFIG_DEBUG_KMEMLEAK |
| 25 | 27 | ||
| 26 | extern void kmemleak_init(void) __ref; | 28 | extern void kmemleak_init(void) __ref; |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 6ea9f919e888..7c95af8d552c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -400,8 +400,8 @@ int memcg_cache_id(struct mem_cgroup *memcg); | |||
| 400 | 400 | ||
| 401 | void memcg_update_array_size(int num_groups); | 401 | void memcg_update_array_size(int num_groups); |
| 402 | 402 | ||
| 403 | struct kmem_cache * | 403 | struct kmem_cache *__memcg_kmem_get_cache(struct kmem_cache *cachep); |
| 404 | __memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp); | 404 | void __memcg_kmem_put_cache(struct kmem_cache *cachep); |
| 405 | 405 | ||
| 406 | int __memcg_charge_slab(struct kmem_cache *cachep, gfp_t gfp, int order); | 406 | int __memcg_charge_slab(struct kmem_cache *cachep, gfp_t gfp, int order); |
| 407 | void __memcg_uncharge_slab(struct kmem_cache *cachep, int order); | 407 | void __memcg_uncharge_slab(struct kmem_cache *cachep, int order); |
| @@ -492,7 +492,13 @@ memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp) | |||
| 492 | if (unlikely(fatal_signal_pending(current))) | 492 | if (unlikely(fatal_signal_pending(current))) |
| 493 | return cachep; | 493 | return cachep; |
| 494 | 494 | ||
| 495 | return __memcg_kmem_get_cache(cachep, gfp); | 495 | return __memcg_kmem_get_cache(cachep); |
| 496 | } | ||
| 497 | |||
| 498 | static __always_inline void memcg_kmem_put_cache(struct kmem_cache *cachep) | ||
| 499 | { | ||
| 500 | if (memcg_kmem_enabled()) | ||
| 501 | __memcg_kmem_put_cache(cachep); | ||
| 496 | } | 502 | } |
| 497 | #else | 503 | #else |
| 498 | #define for_each_memcg_cache_index(_idx) \ | 504 | #define for_each_memcg_cache_index(_idx) \ |
| @@ -528,6 +534,10 @@ memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp) | |||
| 528 | { | 534 | { |
| 529 | return cachep; | 535 | return cachep; |
| 530 | } | 536 | } |
| 537 | |||
| 538 | static inline void memcg_kmem_put_cache(struct kmem_cache *cachep) | ||
| 539 | { | ||
| 540 | } | ||
| 531 | #endif /* CONFIG_MEMCG_KMEM */ | 541 | #endif /* CONFIG_MEMCG_KMEM */ |
| 532 | #endif /* _LINUX_MEMCONTROL_H */ | 542 | #endif /* _LINUX_MEMCONTROL_H */ |
| 533 | 543 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 3b337efbe533..c0a67b894c4c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/bit_spinlock.h> | 19 | #include <linux/bit_spinlock.h> |
| 20 | #include <linux/shrinker.h> | 20 | #include <linux/shrinker.h> |
| 21 | #include <linux/resource.h> | 21 | #include <linux/resource.h> |
| 22 | #include <linux/page_ext.h> | ||
| 22 | 23 | ||
| 23 | struct mempolicy; | 24 | struct mempolicy; |
| 24 | struct anon_vma; | 25 | struct anon_vma; |
| @@ -2060,7 +2061,22 @@ static inline void vm_stat_account(struct mm_struct *mm, | |||
| 2060 | #endif /* CONFIG_PROC_FS */ | 2061 | #endif /* CONFIG_PROC_FS */ |
| 2061 | 2062 | ||
| 2062 | #ifdef CONFIG_DEBUG_PAGEALLOC | 2063 | #ifdef CONFIG_DEBUG_PAGEALLOC |
| 2063 | extern void kernel_map_pages(struct page *page, int numpages, int enable); | 2064 | extern bool _debug_pagealloc_enabled; |
| 2065 | extern void __kernel_map_pages(struct page *page, int numpages, int enable); | ||
| 2066 | |||
| 2067 | static inline bool debug_pagealloc_enabled(void) | ||
| 2068 | { | ||
| 2069 | return _debug_pagealloc_enabled; | ||
| 2070 | } | ||
| 2071 | |||
| 2072 | static inline void | ||
| 2073 | kernel_map_pages(struct page *page, int numpages, int enable) | ||
| 2074 | { | ||
| 2075 | if (!debug_pagealloc_enabled()) | ||
| 2076 | return; | ||
| 2077 | |||
| 2078 | __kernel_map_pages(page, numpages, enable); | ||
| 2079 | } | ||
| 2064 | #ifdef CONFIG_HIBERNATION | 2080 | #ifdef CONFIG_HIBERNATION |
| 2065 | extern bool kernel_page_present(struct page *page); | 2081 | extern bool kernel_page_present(struct page *page); |
| 2066 | #endif /* CONFIG_HIBERNATION */ | 2082 | #endif /* CONFIG_HIBERNATION */ |
| @@ -2094,9 +2110,9 @@ int drop_caches_sysctl_handler(struct ctl_table *, int, | |||
| 2094 | void __user *, size_t *, loff_t *); | 2110 | void __user *, size_t *, loff_t *); |
| 2095 | #endif | 2111 | #endif |
| 2096 | 2112 | ||
| 2097 | unsigned long shrink_slab(struct shrink_control *shrink, | 2113 | unsigned long shrink_node_slabs(gfp_t gfp_mask, int nid, |
| 2098 | unsigned long nr_pages_scanned, | 2114 | unsigned long nr_scanned, |
| 2099 | unsigned long lru_pages); | 2115 | unsigned long nr_eligible); |
| 2100 | 2116 | ||
| 2101 | #ifndef CONFIG_MMU | 2117 | #ifndef CONFIG_MMU |
| 2102 | #define randomize_va_space 0 | 2118 | #define randomize_va_space 0 |
| @@ -2155,20 +2171,36 @@ extern void copy_user_huge_page(struct page *dst, struct page *src, | |||
| 2155 | unsigned int pages_per_huge_page); | 2171 | unsigned int pages_per_huge_page); |
| 2156 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ | 2172 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ |
| 2157 | 2173 | ||
| 2174 | extern struct page_ext_operations debug_guardpage_ops; | ||
| 2175 | extern struct page_ext_operations page_poisoning_ops; | ||
| 2176 | |||
| 2158 | #ifdef CONFIG_DEBUG_PAGEALLOC | 2177 | #ifdef CONFIG_DEBUG_PAGEALLOC |
| 2159 | extern unsigned int _debug_guardpage_minorder; | 2178 | extern unsigned int _debug_guardpage_minorder; |
| 2179 | extern bool _debug_guardpage_enabled; | ||
| 2160 | 2180 | ||
| 2161 | static inline unsigned int debug_guardpage_minorder(void) | 2181 | static inline unsigned int debug_guardpage_minorder(void) |
| 2162 | { | 2182 | { |
| 2163 | return _debug_guardpage_minorder; | 2183 | return _debug_guardpage_minorder; |
| 2164 | } | 2184 | } |
| 2165 | 2185 | ||
| 2186 | static inline bool debug_guardpage_enabled(void) | ||
| 2187 | { | ||
| 2188 | return _debug_guardpage_enabled; | ||
| 2189 | } | ||
| 2190 | |||
| 2166 | static inline bool page_is_guard(struct page *page) | 2191 | static inline bool page_is_guard(struct page *page) |
| 2167 | { | 2192 | { |
| 2168 | return test_bit(PAGE_DEBUG_FLAG_GUARD, &page->debug_flags); | 2193 | struct page_ext *page_ext; |
| 2194 | |||
| 2195 | if (!debug_guardpage_enabled()) | ||
| 2196 | return false; | ||
| 2197 | |||
| 2198 | page_ext = lookup_page_ext(page); | ||
| 2199 | return test_bit(PAGE_EXT_DEBUG_GUARD, &page_ext->flags); | ||
| 2169 | } | 2200 | } |
| 2170 | #else | 2201 | #else |
| 2171 | static inline unsigned int debug_guardpage_minorder(void) { return 0; } | 2202 | static inline unsigned int debug_guardpage_minorder(void) { return 0; } |
| 2203 | static inline bool debug_guardpage_enabled(void) { return false; } | ||
| 2172 | static inline bool page_is_guard(struct page *page) { return false; } | 2204 | static inline bool page_is_guard(struct page *page) { return false; } |
| 2173 | #endif /* CONFIG_DEBUG_PAGEALLOC */ | 2205 | #endif /* CONFIG_DEBUG_PAGEALLOC */ |
| 2174 | 2206 | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index bf9f57529dcf..6d34aa266a8c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #include <linux/rwsem.h> | 10 | #include <linux/rwsem.h> |
| 11 | #include <linux/completion.h> | 11 | #include <linux/completion.h> |
| 12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
| 13 | #include <linux/page-debug-flags.h> | ||
| 14 | #include <linux/uprobes.h> | 13 | #include <linux/uprobes.h> |
| 15 | #include <linux/page-flags-layout.h> | 14 | #include <linux/page-flags-layout.h> |
| 16 | #include <asm/page.h> | 15 | #include <asm/page.h> |
| @@ -186,9 +185,6 @@ struct page { | |||
| 186 | void *virtual; /* Kernel virtual address (NULL if | 185 | void *virtual; /* Kernel virtual address (NULL if |
| 187 | not kmapped, ie. highmem) */ | 186 | not kmapped, ie. highmem) */ |
| 188 | #endif /* WANT_PAGE_VIRTUAL */ | 187 | #endif /* WANT_PAGE_VIRTUAL */ |
| 189 | #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS | ||
| 190 | unsigned long debug_flags; /* Use atomic bitops on this */ | ||
| 191 | #endif | ||
| 192 | 188 | ||
| 193 | #ifdef CONFIG_KMEMCHECK | 189 | #ifdef CONFIG_KMEMCHECK |
| 194 | /* | 190 | /* |
| @@ -534,4 +530,12 @@ enum tlb_flush_reason { | |||
| 534 | NR_TLB_FLUSH_REASONS, | 530 | NR_TLB_FLUSH_REASONS, |
| 535 | }; | 531 | }; |
| 536 | 532 | ||
| 533 | /* | ||
| 534 | * A swap entry has to fit into a "unsigned long", as the entry is hidden | ||
| 535 | * in the "index" field of the swapper address space. | ||
| 536 | */ | ||
| 537 | typedef struct { | ||
| 538 | unsigned long val; | ||
| 539 | } swp_entry_t; | ||
| 540 | |||
| 537 | #endif /* _LINUX_MM_TYPES_H */ | 541 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 88787bb4b3b9..ab8564b03468 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
| @@ -154,7 +154,7 @@ struct mmu_notifier_ops { | |||
| 154 | * Therefore notifier chains can only be traversed when either | 154 | * Therefore notifier chains can only be traversed when either |
| 155 | * | 155 | * |
| 156 | * 1. mmap_sem is held. | 156 | * 1. mmap_sem is held. |
| 157 | * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->rwsem). | 157 | * 2. One of the reverse map locks is held (i_mmap_rwsem or anon_vma->rwsem). |
| 158 | * 3. No other concurrent thread can access the list (release) | 158 | * 3. No other concurrent thread can access the list (release) |
| 159 | */ | 159 | */ |
| 160 | struct mmu_notifier { | 160 | struct mmu_notifier { |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 3879d7664dfc..2f0856d14b21 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -722,6 +722,9 @@ typedef struct pglist_data { | |||
| 722 | int nr_zones; | 722 | int nr_zones; |
| 723 | #ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */ | 723 | #ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */ |
| 724 | struct page *node_mem_map; | 724 | struct page *node_mem_map; |
| 725 | #ifdef CONFIG_PAGE_EXTENSION | ||
| 726 | struct page_ext *node_page_ext; | ||
| 727 | #endif | ||
| 725 | #endif | 728 | #endif |
| 726 | #ifndef CONFIG_NO_BOOTMEM | 729 | #ifndef CONFIG_NO_BOOTMEM |
| 727 | struct bootmem_data *bdata; | 730 | struct bootmem_data *bdata; |
| @@ -1075,6 +1078,7 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
| 1075 | #define SECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SECTION_MASK) | 1078 | #define SECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SECTION_MASK) |
| 1076 | 1079 | ||
| 1077 | struct page; | 1080 | struct page; |
| 1081 | struct page_ext; | ||
| 1078 | struct mem_section { | 1082 | struct mem_section { |
| 1079 | /* | 1083 | /* |
| 1080 | * This is, logically, a pointer to an array of struct | 1084 | * This is, logically, a pointer to an array of struct |
| @@ -1092,6 +1096,14 @@ struct mem_section { | |||
| 1092 | 1096 | ||
| 1093 | /* See declaration of similar field in struct zone */ | 1097 | /* See declaration of similar field in struct zone */ |
| 1094 | unsigned long *pageblock_flags; | 1098 | unsigned long *pageblock_flags; |
| 1099 | #ifdef CONFIG_PAGE_EXTENSION | ||
| 1100 | /* | ||
| 1101 | * If !SPARSEMEM, pgdat doesn't have page_ext pointer. We use | ||
| 1102 | * section. (see page_ext.h about this.) | ||
| 1103 | */ | ||
| 1104 | struct page_ext *page_ext; | ||
| 1105 | unsigned long pad; | ||
| 1106 | #endif | ||
| 1095 | /* | 1107 | /* |
| 1096 | * WARNING: mem_section must be a power-of-2 in size for the | 1108 | * WARNING: mem_section must be a power-of-2 in size for the |
| 1097 | * calculation and use of SECTION_ROOT_MASK to make sense. | 1109 | * calculation and use of SECTION_ROOT_MASK to make sense. |
diff --git a/include/linux/oom.h b/include/linux/oom.h index e8d6e1058723..853698c721f7 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
| @@ -92,6 +92,17 @@ static inline bool oom_gfp_allowed(gfp_t gfp_mask) | |||
| 92 | 92 | ||
| 93 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); | 93 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); |
| 94 | 94 | ||
| 95 | static inline bool task_will_free_mem(struct task_struct *task) | ||
| 96 | { | ||
| 97 | /* | ||
| 98 | * A coredumping process may sleep for an extended period in exit_mm(), | ||
| 99 | * so the oom killer cannot assume that the process will promptly exit | ||
| 100 | * and release memory. | ||
| 101 | */ | ||
| 102 | return (task->flags & PF_EXITING) && | ||
| 103 | !(task->signal->flags & SIGNAL_GROUP_COREDUMP); | ||
| 104 | } | ||
| 105 | |||
| 95 | /* sysctls */ | 106 | /* sysctls */ |
| 96 | extern int sysctl_oom_dump_tasks; | 107 | extern int sysctl_oom_dump_tasks; |
| 97 | extern int sysctl_oom_kill_allocating_task; | 108 | extern int sysctl_oom_kill_allocating_task; |
diff --git a/include/linux/page-debug-flags.h b/include/linux/page-debug-flags.h deleted file mode 100644 index 22691f614043..000000000000 --- a/include/linux/page-debug-flags.h +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | #ifndef LINUX_PAGE_DEBUG_FLAGS_H | ||
| 2 | #define LINUX_PAGE_DEBUG_FLAGS_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * page->debug_flags bits: | ||
| 6 | * | ||
| 7 | * PAGE_DEBUG_FLAG_POISON is set for poisoned pages. This is used to | ||
| 8 | * implement generic debug pagealloc feature. The pages are filled with | ||
| 9 | * poison patterns and set this flag after free_pages(). The poisoned | ||
| 10 | * pages are verified whether the patterns are not corrupted and clear | ||
| 11 | * the flag before alloc_pages(). | ||
| 12 | */ | ||
| 13 | |||
| 14 | enum page_debug_flags { | ||
| 15 | PAGE_DEBUG_FLAG_POISON, /* Page is poisoned */ | ||
| 16 | PAGE_DEBUG_FLAG_GUARD, | ||
| 17 | }; | ||
| 18 | |||
| 19 | /* | ||
| 20 | * Ensure that CONFIG_WANT_PAGE_DEBUG_FLAGS reliably | ||
| 21 | * gets turned off when no debug features are enabling it! | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS | ||
| 25 | #if !defined(CONFIG_PAGE_POISONING) && \ | ||
| 26 | !defined(CONFIG_PAGE_GUARD) \ | ||
| 27 | /* && !defined(CONFIG_PAGE_DEBUG_SOMETHING_ELSE) && ... */ | ||
| 28 | #error WANT_PAGE_DEBUG_FLAGS is turned on with no debug features! | ||
| 29 | #endif | ||
| 30 | #endif /* CONFIG_WANT_PAGE_DEBUG_FLAGS */ | ||
| 31 | |||
| 32 | #endif /* LINUX_PAGE_DEBUG_FLAGS_H */ | ||
diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h new file mode 100644 index 000000000000..d2a2c84c72d0 --- /dev/null +++ b/include/linux/page_ext.h | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | #ifndef __LINUX_PAGE_EXT_H | ||
| 2 | #define __LINUX_PAGE_EXT_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/stacktrace.h> | ||
| 6 | |||
| 7 | struct pglist_data; | ||
| 8 | struct page_ext_operations { | ||
| 9 | bool (*need)(void); | ||
| 10 | void (*init)(void); | ||
| 11 | }; | ||
| 12 | |||
| 13 | #ifdef CONFIG_PAGE_EXTENSION | ||
| 14 | |||
| 15 | /* | ||
| 16 | * page_ext->flags bits: | ||
| 17 | * | ||
| 18 | * PAGE_EXT_DEBUG_POISON is set for poisoned pages. This is used to | ||
| 19 | * implement generic debug pagealloc feature. The pages are filled with | ||
| 20 | * poison patterns and set this flag after free_pages(). The poisoned | ||
| 21 | * pages are verified whether the patterns are not corrupted and clear | ||
| 22 | * the flag before alloc_pages(). | ||
| 23 | */ | ||
| 24 | |||
| 25 | enum page_ext_flags { | ||
| 26 | PAGE_EXT_DEBUG_POISON, /* Page is poisoned */ | ||
| 27 | PAGE_EXT_DEBUG_GUARD, | ||
| 28 | PAGE_EXT_OWNER, | ||
| 29 | }; | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Page Extension can be considered as an extended mem_map. | ||
| 33 | * A page_ext page is associated with every page descriptor. The | ||
| 34 | * page_ext helps us add more information about the page. | ||
| 35 | * All page_ext are allocated at boot or memory hotplug event, | ||
| 36 | * then the page_ext for pfn always exists. | ||
| 37 | */ | ||
| 38 | struct page_ext { | ||
| 39 | unsigned long flags; | ||
| 40 | #ifdef CONFIG_PAGE_OWNER | ||
| 41 | unsigned int order; | ||
| 42 | gfp_t gfp_mask; | ||
| 43 | struct stack_trace trace; | ||
| 44 | unsigned long trace_entries[8]; | ||
| 45 | #endif | ||
| 46 | }; | ||
| 47 | |||
| 48 | extern void pgdat_page_ext_init(struct pglist_data *pgdat); | ||
| 49 | |||
| 50 | #ifdef CONFIG_SPARSEMEM | ||
| 51 | static inline void page_ext_init_flatmem(void) | ||
| 52 | { | ||
| 53 | } | ||
| 54 | extern void page_ext_init(void); | ||
| 55 | #else | ||
| 56 | extern void page_ext_init_flatmem(void); | ||
| 57 | static inline void page_ext_init(void) | ||
| 58 | { | ||
| 59 | } | ||
| 60 | #endif | ||
| 61 | |||
| 62 | struct page_ext *lookup_page_ext(struct page *page); | ||
| 63 | |||
| 64 | #else /* !CONFIG_PAGE_EXTENSION */ | ||
| 65 | struct page_ext; | ||
| 66 | |||
| 67 | static inline void pgdat_page_ext_init(struct pglist_data *pgdat) | ||
| 68 | { | ||
| 69 | } | ||
| 70 | |||
| 71 | static inline struct page_ext *lookup_page_ext(struct page *page) | ||
| 72 | { | ||
| 73 | return NULL; | ||
| 74 | } | ||
| 75 | |||
| 76 | static inline void page_ext_init(void) | ||
| 77 | { | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline void page_ext_init_flatmem(void) | ||
| 81 | { | ||
| 82 | } | ||
| 83 | #endif /* CONFIG_PAGE_EXTENSION */ | ||
| 84 | #endif /* __LINUX_PAGE_EXT_H */ | ||
diff --git a/include/linux/page_owner.h b/include/linux/page_owner.h new file mode 100644 index 000000000000..b48c3471c254 --- /dev/null +++ b/include/linux/page_owner.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #ifndef __LINUX_PAGE_OWNER_H | ||
| 2 | #define __LINUX_PAGE_OWNER_H | ||
| 3 | |||
| 4 | #ifdef CONFIG_PAGE_OWNER | ||
| 5 | extern bool page_owner_inited; | ||
| 6 | extern struct page_ext_operations page_owner_ops; | ||
| 7 | |||
| 8 | extern void __reset_page_owner(struct page *page, unsigned int order); | ||
| 9 | extern void __set_page_owner(struct page *page, | ||
| 10 | unsigned int order, gfp_t gfp_mask); | ||
| 11 | |||
| 12 | static inline void reset_page_owner(struct page *page, unsigned int order) | ||
| 13 | { | ||
| 14 | if (likely(!page_owner_inited)) | ||
| 15 | return; | ||
| 16 | |||
| 17 | __reset_page_owner(page, order); | ||
| 18 | } | ||
| 19 | |||
| 20 | static inline void set_page_owner(struct page *page, | ||
| 21 | unsigned int order, gfp_t gfp_mask) | ||
| 22 | { | ||
| 23 | if (likely(!page_owner_inited)) | ||
| 24 | return; | ||
| 25 | |||
| 26 | __set_page_owner(page, order, gfp_mask); | ||
| 27 | } | ||
| 28 | #else | ||
| 29 | static inline void reset_page_owner(struct page *page, unsigned int order) | ||
| 30 | { | ||
| 31 | } | ||
| 32 | static inline void set_page_owner(struct page *page, | ||
| 33 | unsigned int order, gfp_t gfp_mask) | ||
| 34 | { | ||
| 35 | } | ||
| 36 | |||
| 37 | #endif /* CONFIG_PAGE_OWNER */ | ||
| 38 | #endif /* __LINUX_PAGE_OWNER_H */ | ||
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 420032d41d27..57f3a1c550dc 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -254,8 +254,6 @@ do { \ | |||
| 254 | #endif /* CONFIG_SMP */ | 254 | #endif /* CONFIG_SMP */ |
| 255 | 255 | ||
| 256 | #define per_cpu(var, cpu) (*per_cpu_ptr(&(var), cpu)) | 256 | #define per_cpu(var, cpu) (*per_cpu_ptr(&(var), cpu)) |
| 257 | #define __raw_get_cpu_var(var) (*raw_cpu_ptr(&(var))) | ||
| 258 | #define __get_cpu_var(var) (*this_cpu_ptr(&(var))) | ||
| 259 | 257 | ||
| 260 | /* | 258 | /* |
| 261 | * Must be an lvalue. Since @var must be a simple identifier, | 259 | * Must be an lvalue. Since @var must be a simple identifier, |
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 0a260d8a18bf..18102529254e 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
| @@ -17,14 +17,20 @@ struct ratelimit_state { | |||
| 17 | unsigned long begin; | 17 | unsigned long begin; |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | #define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \ | 20 | #define RATELIMIT_STATE_INIT(name, interval_init, burst_init) { \ |
| 21 | \ | ||
| 22 | struct ratelimit_state name = { \ | ||
| 23 | .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ | 21 | .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ |
| 24 | .interval = interval_init, \ | 22 | .interval = interval_init, \ |
| 25 | .burst = burst_init, \ | 23 | .burst = burst_init, \ |
| 26 | } | 24 | } |
| 27 | 25 | ||
| 26 | #define RATELIMIT_STATE_INIT_DISABLED \ | ||
| 27 | RATELIMIT_STATE_INIT(ratelimit_state, 0, DEFAULT_RATELIMIT_BURST) | ||
| 28 | |||
| 29 | #define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \ | ||
| 30 | \ | ||
| 31 | struct ratelimit_state name = \ | ||
| 32 | RATELIMIT_STATE_INIT(name, interval_init, burst_init) \ | ||
| 33 | |||
| 28 | static inline void ratelimit_state_init(struct ratelimit_state *rs, | 34 | static inline void ratelimit_state_init(struct ratelimit_state *rs, |
| 29 | int interval, int burst) | 35 | int interval, int burst) |
| 30 | { | 36 | { |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 55f5ee7cc3d3..8db31ef98d2f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1364,6 +1364,10 @@ struct task_struct { | |||
| 1364 | unsigned sched_reset_on_fork:1; | 1364 | unsigned sched_reset_on_fork:1; |
| 1365 | unsigned sched_contributes_to_load:1; | 1365 | unsigned sched_contributes_to_load:1; |
| 1366 | 1366 | ||
| 1367 | #ifdef CONFIG_MEMCG_KMEM | ||
| 1368 | unsigned memcg_kmem_skip_account:1; | ||
| 1369 | #endif | ||
| 1370 | |||
| 1367 | unsigned long atomic_flags; /* Flags needing atomic access. */ | 1371 | unsigned long atomic_flags; /* Flags needing atomic access. */ |
| 1368 | 1372 | ||
| 1369 | pid_t pid; | 1373 | pid_t pid; |
| @@ -1679,8 +1683,7 @@ struct task_struct { | |||
| 1679 | /* bitmask and counter of trace recursion */ | 1683 | /* bitmask and counter of trace recursion */ |
| 1680 | unsigned long trace_recursion; | 1684 | unsigned long trace_recursion; |
| 1681 | #endif /* CONFIG_TRACING */ | 1685 | #endif /* CONFIG_TRACING */ |
| 1682 | #ifdef CONFIG_MEMCG /* memcg uses this to do batch job */ | 1686 | #ifdef CONFIG_MEMCG |
| 1683 | unsigned int memcg_kmem_skip_account; | ||
| 1684 | struct memcg_oom_info { | 1687 | struct memcg_oom_info { |
| 1685 | struct mem_cgroup *memcg; | 1688 | struct mem_cgroup *memcg; |
| 1686 | gfp_t gfp_mask; | 1689 | gfp_t gfp_mask; |
| @@ -2482,6 +2485,10 @@ extern void do_group_exit(int); | |||
| 2482 | extern int do_execve(struct filename *, | 2485 | extern int do_execve(struct filename *, |
| 2483 | const char __user * const __user *, | 2486 | const char __user * const __user *, |
| 2484 | const char __user * const __user *); | 2487 | const char __user * const __user *); |
| 2488 | extern int do_execveat(int, struct filename *, | ||
| 2489 | const char __user * const __user *, | ||
| 2490 | const char __user * const __user *, | ||
| 2491 | int); | ||
| 2485 | extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); | 2492 | extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); |
| 2486 | struct task_struct *fork_idle(int); | 2493 | struct task_struct *fork_idle(int); |
| 2487 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 2494 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 68c097077ef0..f4aee75f00b1 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h | |||
| @@ -18,8 +18,6 @@ struct shrink_control { | |||
| 18 | */ | 18 | */ |
| 19 | unsigned long nr_to_scan; | 19 | unsigned long nr_to_scan; |
| 20 | 20 | ||
| 21 | /* shrink from these nodes */ | ||
| 22 | nodemask_t nodes_to_scan; | ||
| 23 | /* current node being shrunk (for NUMA aware shrinkers) */ | 21 | /* current node being shrunk (for NUMA aware shrinkers) */ |
| 24 | int nid; | 22 | int nid; |
| 25 | }; | 23 | }; |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 8a2457d42fc8..9a139b637069 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -493,7 +493,6 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 493 | * @memcg: pointer to the memcg this cache belongs to | 493 | * @memcg: pointer to the memcg this cache belongs to |
| 494 | * @list: list_head for the list of all caches in this memcg | 494 | * @list: list_head for the list of all caches in this memcg |
| 495 | * @root_cache: pointer to the global, root cache, this cache was derived from | 495 | * @root_cache: pointer to the global, root cache, this cache was derived from |
| 496 | * @nr_pages: number of pages that belongs to this cache. | ||
| 497 | */ | 496 | */ |
| 498 | struct memcg_cache_params { | 497 | struct memcg_cache_params { |
| 499 | bool is_root_cache; | 498 | bool is_root_cache; |
| @@ -506,7 +505,6 @@ struct memcg_cache_params { | |||
| 506 | struct mem_cgroup *memcg; | 505 | struct mem_cgroup *memcg; |
| 507 | struct list_head list; | 506 | struct list_head list; |
| 508 | struct kmem_cache *root_cache; | 507 | struct kmem_cache *root_cache; |
| 509 | atomic_t nr_pages; | ||
| 510 | }; | 508 | }; |
| 511 | }; | 509 | }; |
| 512 | }; | 510 | }; |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 115b570e3bff..669045ab73f3 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef __LINUX_STACKTRACE_H | 1 | #ifndef __LINUX_STACKTRACE_H |
| 2 | #define __LINUX_STACKTRACE_H | 2 | #define __LINUX_STACKTRACE_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 4 | struct task_struct; | 6 | struct task_struct; |
| 5 | struct pt_regs; | 7 | struct pt_regs; |
| 6 | 8 | ||
| @@ -20,6 +22,8 @@ extern void save_stack_trace_tsk(struct task_struct *tsk, | |||
| 20 | struct stack_trace *trace); | 22 | struct stack_trace *trace); |
| 21 | 23 | ||
| 22 | extern void print_stack_trace(struct stack_trace *trace, int spaces); | 24 | extern void print_stack_trace(struct stack_trace *trace, int spaces); |
| 25 | extern int snprint_stack_trace(char *buf, size_t size, | ||
| 26 | struct stack_trace *trace, int spaces); | ||
| 23 | 27 | ||
| 24 | #ifdef CONFIG_USER_STACKTRACE_SUPPORT | 28 | #ifdef CONFIG_USER_STACKTRACE_SUPPORT |
| 25 | extern void save_stack_trace_user(struct stack_trace *trace); | 29 | extern void save_stack_trace_user(struct stack_trace *trace); |
| @@ -32,6 +36,7 @@ extern void save_stack_trace_user(struct stack_trace *trace); | |||
| 32 | # define save_stack_trace_tsk(tsk, trace) do { } while (0) | 36 | # define save_stack_trace_tsk(tsk, trace) do { } while (0) |
| 33 | # define save_stack_trace_user(trace) do { } while (0) | 37 | # define save_stack_trace_user(trace) do { } while (0) |
| 34 | # define print_stack_trace(trace, spaces) do { } while (0) | 38 | # define print_stack_trace(trace, spaces) do { } while (0) |
| 39 | # define snprint_stack_trace(buf, size, trace, spaces) do { } while (0) | ||
| 35 | #endif | 40 | #endif |
| 36 | 41 | ||
| 37 | #endif | 42 | #endif |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 37a585beef5c..34e8b60ab973 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -102,14 +102,6 @@ union swap_header { | |||
| 102 | } info; | 102 | } info; |
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | /* A swap entry has to fit into a "unsigned long", as | ||
| 106 | * the entry is hidden in the "index" field of the | ||
| 107 | * swapper address space. | ||
| 108 | */ | ||
| 109 | typedef struct { | ||
| 110 | unsigned long val; | ||
| 111 | } swp_entry_t; | ||
| 112 | |||
| 113 | /* | 105 | /* |
| 114 | * current->reclaim_state points to one of these when a task is running | 106 | * current->reclaim_state points to one of these when a task is running |
| 115 | * memory reclaim | 107 | * memory reclaim |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index c9afdc7a7f84..85893d744901 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -877,4 +877,9 @@ asmlinkage long sys_seccomp(unsigned int op, unsigned int flags, | |||
| 877 | asmlinkage long sys_getrandom(char __user *buf, size_t count, | 877 | asmlinkage long sys_getrandom(char __user *buf, size_t count, |
| 878 | unsigned int flags); | 878 | unsigned int flags); |
| 879 | asmlinkage long sys_bpf(int cmd, union bpf_attr *attr, unsigned int size); | 879 | asmlinkage long sys_bpf(int cmd, union bpf_attr *attr, unsigned int size); |
| 880 | |||
| 881 | asmlinkage long sys_execveat(int dfd, const char __user *filename, | ||
| 882 | const char __user *const __user *argv, | ||
| 883 | const char __user *const __user *envp, int flags); | ||
| 884 | |||
| 880 | #endif | 885 | #endif |
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 730334cdf037..9246d32dc973 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h | |||
| @@ -90,6 +90,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
| 90 | #ifdef CONFIG_DEBUG_VM_VMACACHE | 90 | #ifdef CONFIG_DEBUG_VM_VMACACHE |
| 91 | VMACACHE_FIND_CALLS, | 91 | VMACACHE_FIND_CALLS, |
| 92 | VMACACHE_FIND_HITS, | 92 | VMACACHE_FIND_HITS, |
| 93 | VMACACHE_FULL_FLUSHES, | ||
| 93 | #endif | 94 | #endif |
| 94 | NR_VM_EVENT_ITEMS | 95 | NR_VM_EVENT_ITEMS |
| 95 | }; | 96 | }; |
