/linux-4.4.14/include/linux/ |
H A D | mempolicy.h | 15 #include <uapi/linux/mempolicy.h> 24 * A mempolicy can be either associated with a process or with a VMA. 35 * Mempolicy objects are reference counted. A mempolicy will be freed when 39 * mpol_dup() allocates a new mempolicy and copies the specified mempolicy 43 struct mempolicy { struct 59 * Support for managing mempolicy data objects (clone, copy, destroy) 63 extern void __mpol_put(struct mempolicy *pol); mpol_put() 64 static inline void mpol_put(struct mempolicy *pol) mpol_put() 71 * Does mempolicy pol need explicit unref after use? 74 static inline int mpol_needs_cond_ref(struct mempolicy *pol) mpol_needs_cond_ref() 79 static inline void mpol_cond_put(struct mempolicy *pol) mpol_cond_put() 85 extern struct mempolicy *__mpol_dup(struct mempolicy *pol); mpol_dup() 86 static inline struct mempolicy *mpol_dup(struct mempolicy *pol) mpol_dup() 95 static inline void mpol_get(struct mempolicy *pol) mpol_get() 101 extern bool __mpol_equal(struct mempolicy *a, struct mempolicy *b); mpol_equal() 102 static inline bool mpol_equal(struct mempolicy *a, struct mempolicy *b) mpol_equal() 120 struct mempolicy *policy; 129 void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol); 132 struct mempolicy *new); 134 struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, 137 struct mempolicy *get_task_policy(struct task_struct *p); 138 struct mempolicy *__get_vma_policy(struct vm_area_struct *vma, 150 struct mempolicy **mpol, nodemask_t **nodemask); 169 extern int mpol_parse_str(char *str, struct mempolicy **mpol); 172 extern void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol); 201 struct mempolicy {}; struct 203 static inline bool mpol_equal(struct mempolicy *a, struct mempolicy *b) mpol_equal() 208 static inline void mpol_put(struct mempolicy *p) mpol_put() 212 static inline void mpol_cond_put(struct mempolicy *pol) mpol_cond_put() 216 static inline void mpol_get(struct mempolicy *pol) mpol_get() 223 struct mempolicy *mpol) mpol_shared_policy_init() 259 struct mempolicy **mpol, nodemask_t **nodemask) huge_zonelist() 282 static inline int mpol_parse_str(char *str, struct mempolicy **mpol) mpol_parse_str()
|
H A D | shmem_fs.h | 6 #include <linux/mempolicy.h> 34 struct mempolicy *mpol; /* default memory policy for mappings */
|
H A D | migrate.h | 5 #include <linux/mempolicy.h>
|
H A D | oom.h | 23 /* Used to determine mempolicy */
|
H A D | mm.h | 25 struct mempolicy; 281 * set_policy() op must add a reference to any non-NULL @new mempolicy 285 * mempolicy. 287 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); 292 * in mm/mempolicy.c will do this automatically. 295 * If no [shared/vma] mempolicy exists at the addr, get_policy() op 299 struct mempolicy *(*get_policy)(struct vm_area_struct *vma, 1870 struct mempolicy *, struct vm_userfaultfd_ctx);
|
H A D | hugetlb.h | 18 #include <linux/mempolicy.h>
|
H A D | mm_types.h | 355 struct mempolicy *vm_policy; /* NUMA policy for the VMA */
|
H A D | nodemask.h | 515 /* A example struture for using NODEMASK_ALLOC, used in mempolicy. */
|
H A D | sched.h | 1181 struct mempolicy; prefetch_stack() 1592 * mempolicy */ 1691 struct mempolicy *mempolicy; /* Protected by alloc_lock */ member in struct:task_struct
|
/linux-4.4.14/mm/ |
H A D | mempolicy.c | 70 #include <linux/mempolicy.h> 118 static struct mempolicy default_policy = { 124 static struct mempolicy preferred_node_policy[MAX_NUMNODES]; 126 struct mempolicy *get_task_policy(struct task_struct *p) get_task_policy() 128 struct mempolicy *pol = p->mempolicy; get_task_policy() 146 int (*create)(struct mempolicy *pol, const nodemask_t *nodes); 148 * If read-side task has no lock to protect task->mempolicy, write-side 149 * task will rebind the task->mempolicy by two step. The first step is 153 * If we have a lock to protect task->mempolicy in read-side, we do 161 void (*rebind)(struct mempolicy *pol, const nodemask_t *nodes, 165 static inline int mpol_store_user_nodemask(const struct mempolicy *pol) mpol_store_user_nodemask() 178 static int mpol_new_interleave(struct mempolicy *pol, const nodemask_t *nodes) mpol_new_interleave() 186 static int mpol_new_preferred(struct mempolicy *pol, const nodemask_t *nodes) mpol_new_preferred() 197 static int mpol_new_bind(struct mempolicy *pol, const nodemask_t *nodes) mpol_new_bind() 212 * and mempolicy. May also be called holding the mmap_semaphore for write. 214 static int mpol_set_nodemask(struct mempolicy *pol, mpol_set_nodemask() 253 static struct mempolicy *mpol_new(unsigned short mode, unsigned short flags, mpol_new() 256 struct mempolicy *policy; mpol_new() 296 void __mpol_put(struct mempolicy *p) __mpol_put() 303 static void mpol_rebind_default(struct mempolicy *pol, const nodemask_t *nodes, mpol_rebind_default() 314 static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes, mpol_rebind_nodemask() 358 static void mpol_rebind_preferred(struct mempolicy *pol, mpol_rebind_preferred() 386 * If read-side task has no lock to protect task->mempolicy, write-side 387 * task will rebind the task->mempolicy by two step. The first step is 391 * If we have a lock to protect task->mempolicy in read-side, we do 399 static void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *newmask, mpol_rebind_policy() 426 * pointer, and updates task mempolicy. 434 mpol_rebind_policy(tsk->mempolicy, new, step); mpol_rebind_task() 660 struct mempolicy *pol) vma_replace_policy() 663 struct mempolicy *old; vma_replace_policy() 664 struct mempolicy *new; vma_replace_policy() 693 unsigned long end, struct mempolicy *new_pol) mbind_range() 756 struct mempolicy *new, *old; do_set_mempolicy() 776 old = current->mempolicy; do_set_mempolicy() 777 current->mempolicy = new; do_set_mempolicy() 794 static void get_policy_nodemask(struct mempolicy *p, nodemask_t *nodes) get_policy_nodemask() 836 struct mempolicy *pol = current->mempolicy; do_get_mempolicy() 880 } else if (pol == current->mempolicy && do_get_mempolicy() 891 * Internal mempolicy flags must be masked off before exposing do_get_mempolicy() 1140 struct mempolicy *new; do_mbind() 1541 struct mempolicy *__get_vma_policy(struct vm_area_struct *vma, __get_vma_policy() 1544 struct mempolicy *pol = NULL; __get_vma_policy() 1572 * Falls back to current->mempolicy or system default policy, as necessary. 1578 static struct mempolicy *get_vma_policy(struct vm_area_struct *vma, get_vma_policy() 1581 struct mempolicy *pol = __get_vma_policy(vma, addr); get_vma_policy() 1591 struct mempolicy *pol; vma_policy_mof() 1611 static int apply_policy_zone(struct mempolicy *policy, enum zone_type zone) apply_policy_zone() 1632 * Return a nodemask representing a mempolicy for filtering nodes for 1635 static nodemask_t *policy_nodemask(gfp_t gfp, struct mempolicy *policy) policy_nodemask() 1646 /* Return a zonelist indicated by gfp for node representing a mempolicy */ policy_zonelist() 1647 static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy, policy_zonelist() 1673 static unsigned interleave_nodes(struct mempolicy *policy) interleave_nodes() 1693 struct mempolicy *policy; mempolicy_slab_node() 1699 policy = current->mempolicy; mempolicy_slab_node() 1734 static unsigned offset_il_node(struct mempolicy *pol, offset_il_node() 1754 static inline unsigned interleave_nid(struct mempolicy *pol, interleave_nid() 1796 * @mpol: pointer to mempolicy pointer for reference counted mempolicy 1800 * to the struct mempolicy for conditional unref after allocation. 1801 * If the effective policy is 'BIND, returns a pointer to the mempolicy's 1807 gfp_t gfp_flags, struct mempolicy **mpol, huge_zonelist() 1829 * If the current task's mempolicy is "default" [NULL], return 'false' 1834 * of non-default mempolicy. 1836 * We don't bother with reference counting the mempolicy [mpol_get/put] 1837 * because the current task is examining it's own mempolicy and a task's 1838 * mempolicy is only ever changed by the task itself. 1844 struct mempolicy *mempolicy; init_nodemask_of_mempolicy() local 1847 if (!(mask && current->mempolicy)) init_nodemask_of_mempolicy() 1851 mempolicy = current->mempolicy; init_nodemask_of_mempolicy() 1852 switch (mempolicy->mode) { init_nodemask_of_mempolicy() 1854 if (mempolicy->flags & MPOL_F_LOCAL) init_nodemask_of_mempolicy() 1857 nid = mempolicy->v.preferred_node; init_nodemask_of_mempolicy() 1864 *mask = mempolicy->v.nodes; init_nodemask_of_mempolicy() 1879 * If tsk's mempolicy is "default" [NULL], return 'true' to indicate default 1884 * Takes task_lock(tsk) to prevent freeing of its mempolicy. 1889 struct mempolicy *mempolicy; mempolicy_nodemask_intersects() local 1895 mempolicy = tsk->mempolicy; mempolicy_nodemask_intersects() 1896 if (!mempolicy) mempolicy_nodemask_intersects() 1899 switch (mempolicy->mode) { mempolicy_nodemask_intersects() 1910 ret = nodes_intersects(mempolicy->v.nodes, *mask); mempolicy_nodemask_intersects() 1962 struct mempolicy *pol; alloc_pages_vma() 2038 struct mempolicy *pol = &default_policy; alloc_pages_current() 2049 * No reference counting needed for current->mempolicy alloc_pages_current() 2068 struct mempolicy *pol = mpol_dup(vma_policy(src)); vma_dup_policy() 2078 * rebinds the mempolicy its copying by calling mpol_rebind_policy() 2083 * current's mempolicy may be rebinded by the other task(the task that changes 2087 /* Slow path of a mempolicy duplicate */ __mpol_dup() 2088 struct mempolicy *__mpol_dup(struct mempolicy *old) __mpol_dup() 2090 struct mempolicy *new = kmem_cache_alloc(policy_cache, GFP_KERNEL); __mpol_dup() 2095 /* task's mempolicy is protected by alloc_lock */ __mpol_dup() 2096 if (old == current->mempolicy) { __mpol_dup() 2114 /* Slow path of a mempolicy comparison */ __mpol_equal() 2115 bool __mpol_equal(struct mempolicy *a, struct mempolicy *b) __mpol_equal() 2206 struct mempolicy * mpol_shared_policy_lookup() 2209 struct mempolicy *pol = NULL; mpol_shared_policy_lookup() 2249 struct mempolicy *pol; mpol_misplaced() 2325 unsigned long end, struct mempolicy *pol) sp_node_init() 2333 struct mempolicy *pol) sp_alloc() 2336 struct mempolicy *newpol; sp_alloc() 2359 struct mempolicy *mpol_new = NULL; shared_policy_replace() 2422 * @mpol: struct mempolicy to install 2429 void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol) mpol_shared_policy_init() 2433 sp->root = RB_ROOT; /* empty tree == default mempolicy */ mpol_shared_policy_init() 2438 struct mempolicy *new; mpol_shared_policy_init() 2443 /* contextualize the tmpfs mount point mempolicy */ mpol_shared_policy_init() 2469 struct vm_area_struct *vma, struct mempolicy *npol) mpol_set_shared_policy() 2567 sizeof(struct mempolicy), numa_policy_init() 2575 preferred_node_policy[nid] = (struct mempolicy) { for_each_node() 2620 * Parse and format mempolicy from/to strings 2638 * mpol_parse_str - parse string to mempolicy, for tmpfs mpol mount option. 2639 * @str: string containing mempolicy to parse 2640 * @mpol: pointer to struct mempolicy pointer, returned on success. 2647 int mpol_parse_str(char *str, struct mempolicy **mpol) mpol_parse_str() 2649 struct mempolicy *new = NULL; mpol_parse_str() 2752 * the mempolicy in a specific context [cpuset] at a later time. mpol_parse_str() 2771 * mpol_to_str - format a mempolicy structure for printing 2772 * @buffer: to contain formatted mempolicy string 2774 * @pol: pointer to mempolicy to be formatted 2780 void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) mpol_to_str()
|
H A D | Makefile | 45 obj-$(CONFIG_NUMA) += mempolicy.o
|
H A D | oom_kill.c | 32 #include <linux/mempolicy.h> 52 * @mask: nodemask passed to page allocator for mempolicy ooms 55 * shares the same mempolicy nodes as current if it is bound by such a policy 68 * If this is a mempolicy constrained oom, tsk's for_each_thread() 70 * mempolicy intersects current, otherwise it may be for_each_thread() 76 * This is not a mempolicy constrained oom, so only for_each_thread() 232 * the page allocator means a mempolicy is in effect. Cpuset policy constrained_alloc() 345 * @nodemask: nodemask passed to page allocator for mempolicy ooms 348 * memcg, not in the same cpuset, or bound to a disjoint set of mempolicy nodes 636 * does not panic for cpuset, mempolicy, or memcg allocation check_panic_on_oom()
|
H A D | shmem.c | 62 #include <linux/mempolicy.h> 871 static void shmem_show_mpol(struct seq_file *seq, struct mempolicy *mpol) shmem_show_mpol() 883 static struct mempolicy *shmem_get_sbmpol(struct shmem_sb_info *sbinfo) shmem_get_sbmpol() 885 struct mempolicy *mpol = NULL; shmem_get_sbmpol() 939 static inline void shmem_show_mpol(struct seq_file *seq, struct mempolicy *mpol) shmem_show_mpol() 958 static inline struct mempolicy *shmem_get_sbmpol(struct shmem_sb_info *sbinfo) shmem_get_sbmpol() 973 * NUMA mempolicy, and applied also to anonymous pages in do_swap_page(); 1365 static int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *mpol) shmem_set_policy() 1371 static struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, shmem_get_policy() 2751 struct mempolicy *mpol = NULL; shmem_parse_options() 2884 * Preserve previous mempolicy unless mpol remount option was specified. shmem_remount_fs()
|
H A D | mprotect.c | 18 #include <linux/mempolicy.h>
|
H A D | madvise.c | 11 #include <linux/mempolicy.h>
|
H A D | swap_state.c | 451 * @addr: target address for mempolicy
|
H A D | mlock.c | 15 #include <linux/mempolicy.h>
|
H A D | hugetlb.c | 15 #include <linux/mempolicy.h> 881 struct mempolicy *mpol; dequeue_huge_page_vma() 1466 * The mempolicy stuff below has some non-inlined bits __hugetlb_alloc_buddy_huge_page() 1487 * OK, so we have a VMA. Fetch the mempolicy and try to __hugetlb_alloc_buddy_huge_page() 1493 struct mempolicy *mpol; __hugetlb_alloc_buddy_huge_page() 2336 * hstate attribute for optionally mempolicy-based constraint on persistent
|
H A D | slab.c | 110 #include <linux/mempolicy.h> 2973 * Try allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set. 2976 * mempolicy, may not apply and should not be used for allocation policy. 2987 else if (current->mempolicy) alternate_node_alloc() 3206 if (current->mempolicy || cpuset_do_slab_mem_spread()) { __do_cache_alloc()
|
H A D | migrate.c | 30 #include <linux/mempolicy.h>
|
H A D | mmap.c | 31 #include <linux/mempolicy.h> 1044 pgoff_t pgoff, struct mempolicy *policy, vma_merge()
|
H A D | slub.c | 27 #include <linux/mempolicy.h>
|
H A D | page_alloc.c | 45 #include <linux/mempolicy.h>
|
/linux-4.4.14/include/uapi/linux/ |
H A D | mempolicy.h | 12 * Both the MPOL_* mempolicy mode and the MPOL_F_* optional mode flags are 62 * Internal flags that share the struct mempolicy flags word with 64 * are never OR'ed into the mode in mempolicy API arguments.
|
/linux-4.4.14/fs/proc/ |
H A D | internal.h | 19 struct mempolicy; 286 struct mempolicy *task_mempolicy; proc_tty_init()
|
H A D | task_mmu.c | 11 #include <linux/mempolicy.h> 1544 struct mempolicy *pol; show_numa_map()
|
/linux-4.4.14/kernel/sched/ |
H A D | debug.c | 18 #include <linux/mempolicy.h> 525 struct mempolicy *pol; sched_show_numa() 531 pol = p->mempolicy; sched_show_numa()
|
H A D | fair.c | 30 #include <linux/mempolicy.h>
|
/linux-4.4.14/arch/tile/kernel/ |
H A D | sys.c | 26 #include <linux/mempolicy.h>
|
/linux-4.4.14/kernel/ |
H A D | fork.c | 21 #include <linux/mempolicy.h> 1375 p->mempolicy = mpol_dup(p->mempolicy); copy_process() 1376 if (IS_ERR(p->mempolicy)) { copy_process() 1377 retval = PTR_ERR(p->mempolicy); copy_process() 1378 p->mempolicy = NULL; copy_process() 1651 mpol_put(p->mempolicy); copy_process()
|
H A D | cpuset.c | 37 #include <linux/mempolicy.h> 153 return task->mempolicy; task_has_mempolicy() 273 * Now, the task_struct fields mems_allowed and mempolicy may be changed 1023 * cpuset_change_task_nodemask - change task's mems_allowed and mempolicy 1049 * tsk does not have a mempolicy, then an empty nodemask will not be cpuset_change_task_nodemask() 1195 * update mems_allowed and rebind task's mempolicy and any vma
|
H A D | exit.c | 32 #include <linux/mempolicy.h> 773 mpol_put(tsk->mempolicy); do_exit() 774 tsk->mempolicy = NULL; do_exit()
|
H A D | workqueue.c | 39 #include <linux/mempolicy.h>
|
/linux-4.4.14/fs/kernfs/ |
H A D | file.c | 411 struct mempolicy *new) kernfs_vma_set_policy() 431 static struct mempolicy *kernfs_vma_get_policy(struct vm_area_struct *vma, kernfs_vma_get_policy() 436 struct mempolicy *pol; kernfs_vma_get_policy()
|
/linux-4.4.14/ipc/ |
H A D | shm.c | 385 static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new) shm_set_policy() 395 static struct mempolicy *shm_get_policy(struct vm_area_struct *vma, shm_get_policy() 400 struct mempolicy *pol = NULL; shm_get_policy()
|
/linux-4.4.14/init/ |
H A D | main.c | 51 #include <linux/mempolicy.h>
|
/linux-4.4.14/drivers/gpu/drm/i915/ |
H A D | i915_gem_userptr.c | 32 #include <linux/mempolicy.h>
|
/linux-4.4.14/fs/ |
H A D | userfaultfd.c | 26 #include <linux/mempolicy.h>
|
/linux-4.4.14/drivers/pci/ |
H A D | pci-driver.c | 15 #include <linux/mempolicy.h>
|