Lines Matching refs:mode
124 .mode = MPOL_PREFERRED,
168 if (pol->mode) in get_task_policy()
242 if (pol->mode == MPOL_PREFERRED && nodes_empty(*nodes)) in mpol_set_nodemask()
258 ret = mpol_ops[pol->mode].create(pol, &nsc->mask2); in mpol_set_nodemask()
260 ret = mpol_ops[pol->mode].create(pol, NULL); in mpol_set_nodemask()
268 static struct mempolicy *mpol_new(unsigned short mode, unsigned short flags, in mpol_new() argument
274 mode, flags, nodes ? nodes_addr(*nodes)[0] : NUMA_NO_NODE); in mpol_new()
276 if (mode == MPOL_DEFAULT) { in mpol_new()
288 if (mode == MPOL_PREFERRED) { in mpol_new()
294 } else if (mode == MPOL_LOCAL) { in mpol_new()
299 mode = MPOL_PREFERRED; in mpol_new()
306 policy->mode = mode; in mpol_new()
377 if (!pol || pol->mode == MPOL_LOCAL) in mpol_rebind_policy()
383 mpol_ops[pol->mode].rebind(pol, newmask); in mpol_rebind_policy()
868 static long do_set_mempolicy(unsigned short mode, unsigned short flags, in do_set_mempolicy() argument
878 new = mpol_new(mode, flags, nodes); in do_set_mempolicy()
892 if (new && new->mode == MPOL_INTERLEAVE) in do_set_mempolicy()
913 switch (p->mode) { in get_policy_nodemask()
1005 pol->mode == MPOL_INTERLEAVE) { in do_get_mempolicy()
1013 pol->mode; in do_get_mempolicy()
1275 unsigned short mode, unsigned short mode_flags, in do_mbind() argument
1293 if (mode == MPOL_DEFAULT) in do_mbind()
1304 new = mpol_new(mode, mode_flags, nmask); in do_mbind()
1319 start, start + len, mode, mode_flags, in do_mbind()
1460 unsigned long mode, const unsigned long __user *nmask, in kernel_mbind() argument
1468 mode_flags = mode & MPOL_MODE_FLAGS; in kernel_mbind()
1469 mode &= ~MPOL_MODE_FLAGS; in kernel_mbind()
1470 if (mode >= MPOL_MAX) in kernel_mbind()
1478 return do_mbind(start, len, mode, mode_flags, &nodes, flags); in kernel_mbind()
1482 unsigned long, mode, const unsigned long __user *, nmask, in SYSCALL_DEFINE6() argument
1485 return kernel_mbind(start, len, mode, nmask, maxnode, flags); in SYSCALL_DEFINE6()
1489 static long kernel_set_mempolicy(int mode, const unsigned long __user *nmask, in kernel_set_mempolicy() argument
1496 flags = mode & MPOL_MODE_FLAGS; in kernel_set_mempolicy()
1497 mode &= ~MPOL_MODE_FLAGS; in kernel_set_mempolicy()
1498 if ((unsigned int)mode >= MPOL_MAX) in kernel_set_mempolicy()
1505 return do_set_mempolicy(mode, flags, &nodes); in kernel_set_mempolicy()
1508 SYSCALL_DEFINE3(set_mempolicy, int, mode, const unsigned long __user *, nmask, in SYSCALL_DEFINE3() argument
1511 return kernel_set_mempolicy(mode, nmask, maxnode); in SYSCALL_DEFINE3()
1679 COMPAT_SYSCALL_DEFINE3(set_mempolicy, int, mode, compat_ulong_t __user *, nmask, in COMPAT_SYSCALL_DEFINE3() argument
1697 return kernel_set_mempolicy(mode, nm, nr_bits+1); in COMPAT_SYSCALL_DEFINE3()
1701 compat_ulong_t, mode, compat_ulong_t __user *, nmask, in COMPAT_SYSCALL_DEFINE6() argument
1719 return kernel_mbind(start, len, mode, nm, nr_bits+1, flags); in COMPAT_SYSCALL_DEFINE6()
1887 if (unlikely(policy->mode == MPOL_BIND) && in policy_nodemask()
1898 if (policy->mode == MPOL_PREFERRED && !(policy->flags & MPOL_F_LOCAL)) in policy_node()
1906 WARN_ON_ONCE(policy->mode == MPOL_BIND && (gfp & __GFP_THISNODE)); in policy_node()
1940 switch (policy->mode) { in mempolicy_slab_node()
2037 if (unlikely((*mpol)->mode == MPOL_INTERLEAVE)) { in huge_node()
2042 if ((*mpol)->mode == MPOL_BIND) in huge_node()
2074 switch (mempolicy->mode) { in init_nodemask_of_mempolicy()
2120 switch (mempolicy->mode) { in mempolicy_nodemask_intersects()
2194 if (pol->mode == MPOL_INTERLEAVE) { in alloc_pages_vma()
2216 if (pol->mode == MPOL_PREFERRED && !(pol->flags & MPOL_F_LOCAL)) in alloc_pages_vma()
2279 if (pol->mode == MPOL_INTERLEAVE) in alloc_pages_current()
2340 if (a->mode != b->mode) in __mpol_equal()
2348 switch (a->mode) { in __mpol_equal()
2429 new->policy ? new->policy->mode : 0); in sp_insert()
2489 switch (pol->mode) { in mpol_misplaced()
2685 new = mpol_new(mpol->mode, mpol->flags, &mpol->w.user_nodemask); in mpol_shared_policy_init()
2718 sz, npol ? npol->mode : -1, in mpol_set_shared_policy()
2816 .mode = MPOL_PREFERRED, in numa_policy_init()
2893 int err = 1, mode; in mpol_parse_str() local
2908 mode = match_string(policy_modes, MPOL_MAX, str); in mpol_parse_str()
2909 if (mode < 0) in mpol_parse_str()
2912 switch (mode) { in mpol_parse_str()
2942 mode = MPOL_PREFERRED; in mpol_parse_str()
2973 new = mpol_new(mode, mode_flags, &nodes); in mpol_parse_str()
2981 if (mode != MPOL_PREFERRED) in mpol_parse_str()
3022 unsigned short mode = MPOL_DEFAULT; in mpol_to_str() local
3026 mode = pol->mode; in mpol_to_str()
3030 switch (mode) { in mpol_to_str()
3035 mode = MPOL_LOCAL; in mpol_to_str()
3049 p += snprintf(p, maxlen, "%s", policy_modes[mode]); in mpol_to_str()