Lines Matching defs:mempolicy

73 #include <linux/mempolicy.h>
126 static struct mempolicy default_policy = {
131 static struct mempolicy preferred_node_policy[MAX_NUMNODES];
165 struct mempolicy *get_task_policy(struct task_struct *p)
167 struct mempolicy *pol = p->mempolicy;
185 int (*create)(struct mempolicy *pol, const nodemask_t *nodes);
186 void (*rebind)(struct mempolicy *pol, const nodemask_t *nodes);
189 static inline int mpol_store_user_nodemask(const struct mempolicy *pol)
202 static int mpol_new_nodemask(struct mempolicy *pol, const nodemask_t *nodes)
210 static int mpol_new_preferred(struct mempolicy *pol, const nodemask_t *nodes)
226 * and mempolicy. May also be called holding the mmap_lock for write.
228 static int mpol_set_nodemask(struct mempolicy *pol,
265 static struct mempolicy *mpol_new(unsigned short mode, unsigned short flags,
268 struct mempolicy *policy;
312 void __mpol_put(struct mempolicy *p)
319 static void mpol_rebind_default(struct mempolicy *pol, const nodemask_t *nodes)
323 static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes)
343 static void mpol_rebind_preferred(struct mempolicy *pol,
356 static void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *newmask)
369 * pointer, and updates task mempolicy.
376 mpol_rebind_policy(tsk->mempolicy, new);
780 struct mempolicy *pol)
783 struct mempolicy *old;
784 struct mempolicy *new;
816 unsigned long end, struct mempolicy *new_pol)
865 struct mempolicy *new, *old;
886 old = current->mempolicy;
887 current->mempolicy = new;
903 static void get_policy_nodemask(struct mempolicy *p, nodemask_t *nodes)
944 struct mempolicy *pol = current->mempolicy, *pol_refcount = NULL;
997 } else if (pol == current->mempolicy &&
1008 * Internal mempolicy flags must be masked off before exposing
1272 struct mempolicy *new;
1513 struct mempolicy *new, *old;
1769 struct mempolicy *__get_vma_policy(struct vm_area_struct *vma,
1772 struct mempolicy *pol = NULL;
1800 * Falls back to current->mempolicy or system default policy, as necessary.
1806 static struct mempolicy *get_vma_policy(struct vm_area_struct *vma,
1809 struct mempolicy *pol = __get_vma_policy(vma, addr);
1819 struct mempolicy *pol;
1839 bool apply_policy_zone(struct mempolicy *policy, enum zone_type zone)
1860 * Return a nodemask representing a mempolicy for filtering nodes for
1863 nodemask_t *policy_nodemask(gfp_t gfp, struct mempolicy *policy)
1880 * Return the preferred node id for 'prefer' mempolicy, and return
1886 static int policy_node(gfp_t gfp, struct mempolicy *policy, int nd)
1908 static unsigned interleave_nodes(struct mempolicy *policy)
1925 struct mempolicy *policy;
1931 policy = current->mempolicy;
1971 static unsigned offset_il_node(struct mempolicy *pol, unsigned long n)
1997 static inline unsigned interleave_nid(struct mempolicy *pol,
2024 * @mpol: pointer to mempolicy pointer for reference counted mempolicy
2028 * to the struct mempolicy for conditional unref after allocation.
2030 * to the mempolicy's @nodemask for filtering the zonelist.
2035 struct mempolicy **mpol, nodemask_t **nodemask)
2058 * If the current task's mempolicy is "default" [NULL], return 'false'
2063 * of non-default mempolicy.
2065 * We don't bother with reference counting the mempolicy [mpol_get/put]
2066 * because the current task is examining it's own mempolicy and a task's
2067 * mempolicy is only ever changed by the task itself.
2073 struct mempolicy *mempolicy;
2075 if (!(mask && current->mempolicy))
2079 mempolicy = current->mempolicy;
2080 switch (mempolicy->mode) {
2085 *mask = mempolicy->nodes;
2104 * If tsk's mempolicy is "bind", check for intersection between mask and
2109 * Takes task_lock(tsk) to prevent freeing of its mempolicy.
2114 struct mempolicy *mempolicy;
2121 mempolicy = tsk->mempolicy;
2122 if (mempolicy && mempolicy->mode == MPOL_BIND)
2123 ret = nodes_intersects(mempolicy->nodes, *mask);
2149 int nid, struct mempolicy *pol)
2187 struct mempolicy *pol;
2287 struct mempolicy *pol = &default_policy;
2294 * No reference counting needed for current->mempolicy
2323 struct mempolicy *pol, unsigned long nr_pages,
2358 struct mempolicy *pol, unsigned long nr_pages,
2377 /* alloc pages bulk and mempolicy should be considered at the
2386 struct mempolicy *pol = &default_policy;
2406 struct mempolicy *pol = mpol_dup(vma_policy(src));
2416 * rebinds the mempolicy its copying by calling mpol_rebind_policy()
2421 * current's mempolicy may be rebinded by the other task(the task that changes
2425 /* Slow path of a mempolicy duplicate */
2426 struct mempolicy *__mpol_dup(struct mempolicy *old)
2428 struct mempolicy *new = kmem_cache_alloc(policy_cache, GFP_KERNEL);
2433 /* task's mempolicy is protected by alloc_lock */
2434 if (old == current->mempolicy) {
2449 /* Slow path of a mempolicy comparison */
2450 bool __mpol_equal(struct mempolicy *a, struct mempolicy *b)
2548 struct mempolicy *
2551 struct mempolicy *pol = NULL;
2588 struct mempolicy *pol;
2663 * Drop the (possibly final) reference to task->mempolicy. It needs to be
2664 * dropped after task->mempolicy is set to NULL so that any allocation done as
2670 struct mempolicy *pol;
2673 pol = task->mempolicy;
2674 task->mempolicy = NULL;
2687 unsigned long end, struct mempolicy *pol)
2695 struct mempolicy *pol)
2698 struct mempolicy *newpol;
2721 struct mempolicy *mpol_new = NULL;
2785 * @mpol: struct mempolicy to install
2792 void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
2796 sp->root = RB_ROOT; /* empty tree == default mempolicy */
2801 struct mempolicy *new;
2806 /* contextualize the tmpfs mount point mempolicy */
2832 struct vm_area_struct *vma, struct mempolicy *npol)
2928 sizeof(struct mempolicy),
2936 preferred_node_policy[nid] = (struct mempolicy) {
2981 * Parse and format mempolicy from/to strings
2997 * mpol_parse_str - parse string to mempolicy, for tmpfs mpol mount option.
2998 * @str: string containing mempolicy to parse
2999 * @mpol: pointer to struct mempolicy pointer, returned on success.
3006 int mpol_parse_str(char *str, struct mempolicy **mpol)
3008 struct mempolicy *new = NULL;
3112 * the mempolicy in a specific context [cpuset] at a later time.
3131 * mpol_to_str - format a mempolicy structure for printing
3132 * @buffer: to contain formatted mempolicy string
3134 * @pol: pointer to mempolicy to be formatted
3140 void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)