Lines Matching full:nodes
15 * interleave Allocate memory interleaved over a set of nodes,
23 * Allocate memory interleaved over a set of nodes based on
29 * bind Only allocate memory on a specific set of nodes,
33 * the allocation to memory nodes instead
41 * preferred many Try a set of nodes first before normal fallback. This is
219 int (*create)(struct mempolicy *pol, const nodemask_t *nodes);
220 void (*rebind)(struct mempolicy *pol, const nodemask_t *nodes);
236 static int mpol_new_nodemask(struct mempolicy *pol, const nodemask_t *nodes) in mpol_new_nodemask() argument
238 if (nodes_empty(*nodes)) in mpol_new_nodemask()
240 pol->nodes = *nodes; in mpol_new_nodemask()
244 static int mpol_new_preferred(struct mempolicy *pol, const nodemask_t *nodes) in mpol_new_preferred() argument
246 if (nodes_empty(*nodes)) in mpol_new_preferred()
249 nodes_clear(pol->nodes); in mpol_new_preferred()
250 node_set(first_node(*nodes), pol->nodes); in mpol_new_preferred()
256 * any, for the new policy. mpol_new() has already validated the nodes
263 const nodemask_t *nodes, struct nodemask_scratch *nsc) in mpol_set_nodemask() argument
279 VM_BUG_ON(!nodes); in mpol_set_nodemask()
282 mpol_relative_nodemask(&nsc->mask2, nodes, &nsc->mask1); in mpol_set_nodemask()
284 nodes_and(nsc->mask2, *nodes, nsc->mask1); in mpol_set_nodemask()
287 pol->w.user_nodemask = *nodes; in mpol_set_nodemask()
297 * initialization. You must invoke mpol_set_nodemask() to set nodes.
300 nodemask_t *nodes) in mpol_new() argument
305 if (nodes && !nodes_empty(*nodes)) in mpol_new()
309 VM_BUG_ON(!nodes); in mpol_new()
317 if (nodes_empty(*nodes)) { in mpol_new()
325 if (!nodes_empty(*nodes) || in mpol_new()
329 } else if (nodes_empty(*nodes)) in mpol_new()
351 static void mpol_rebind_default(struct mempolicy *pol, const nodemask_t *nodes) in mpol_rebind_default() argument
355 static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes) in mpol_rebind_nodemask() argument
360 nodes_and(tmp, pol->w.user_nodemask, *nodes); in mpol_rebind_nodemask()
362 mpol_relative_nodemask(&tmp, &pol->w.user_nodemask, nodes); in mpol_rebind_nodemask()
364 nodes_remap(tmp, pol->nodes, pol->w.cpuset_mems_allowed, in mpol_rebind_nodemask()
365 *nodes); in mpol_rebind_nodemask()
366 pol->w.cpuset_mems_allowed = *nodes; in mpol_rebind_nodemask()
370 tmp = *nodes; in mpol_rebind_nodemask()
372 pol->nodes = tmp; in mpol_rebind_nodemask()
376 const nodemask_t *nodes) in mpol_rebind_preferred() argument
378 pol->w.cpuset_mems_allowed = *nodes; in mpol_rebind_preferred()
382 * mpol_rebind_policy - Migrate a policy to a different set of nodes
723 * Check page nodes, and queue pages to move, in the current vma. in queue_pages_test_walk()
748 * If pages found in a given range are not on the required set of @nodes,
761 nodemask_t *nodes, unsigned long flags, in queue_pages_range() argument
768 .nmask = nodes, in queue_pages_range()
848 nodemask_t *nodes) in do_set_mempolicy() argument
857 new = mpol_new(mode, flags, nodes); in do_set_mempolicy()
864 ret = mpol_set_nodemask(new, nodes, scratch); in do_set_mempolicy()
891 static void get_policy_nodemask(struct mempolicy *pol, nodemask_t *nodes) in get_policy_nodemask() argument
893 nodes_clear(*nodes); in get_policy_nodemask()
903 *nodes = pol->nodes; in get_policy_nodemask()
986 *policy = next_node_in(current->il_prev, pol->nodes); in do_get_mempolicy()
993 pol->nodes); in do_get_mempolicy()
1136 * This lets us pick a pair of nodes to migrate between, such that in do_migrate_pages()
1165 * However if the number of source nodes is not equal to in do_migrate_pages()
1166 * the number of destination nodes we can not preserve in do_migrate_pages()
1186 /* dest not in remaining from nodes? */ in do_migrate_pages()
1353 * targeted nodes, for the first VMA to be migrated; for later in do_mbind()
1354 * VMAs, the nodes will still be interleaved from the targeted in do_mbind()
1434 static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask, in get_nodes() argument
1438 nodes_clear(*nodes); in get_nodes()
1445 * When the user specified more nodes than supported just check in get_nodes()
1466 return get_bitmap(nodes_addr(*nodes), nmask, maxnode); in get_nodes()
1471 nodemask_t *nodes) in copy_nodes_to_user() argument
1491 nodes_addr(*nodes), maxnode); in copy_nodes_to_user()
1493 return copy_to_user(mask, nodes_addr(*nodes), copy) ? -EFAULT : 0; in copy_nodes_to_user()
1520 nodemask_t nodes; in kernel_mbind() local
1529 err = get_nodes(&nodes, nmask, maxnode); in kernel_mbind()
1533 return do_mbind(start, len, lmode, mode_flags, &nodes, flags); in kernel_mbind()
1615 nodemask_t nodes; in kernel_set_mempolicy() local
1623 err = get_nodes(&nodes, nmask, maxnode); in kernel_set_mempolicy()
1627 return do_set_mempolicy(lmode, mode_flags, &nodes); in kernel_set_mempolicy()
1686 /* Is the user allowed to access the target nodes? */ in kernel_migrate_pages()
1739 nodemask_t nodes; in kernel_get_mempolicy() local
1746 err = do_get_mempolicy(&pval, &nodes, addr, flags); in kernel_get_mempolicy()
1755 err = copy_nodes_to_user(nmask, maxnode, &nodes); in kernel_get_mempolicy()
1864 * if policy->nodes has movable memory only, in apply_policy_zone()
1867 * policy->nodes is intersect with node_states[N_MEMORY]. in apply_policy_zone()
1869 * policy->nodes has movable memory only. in apply_policy_zone()
1871 if (!nodes_intersects(policy->nodes, node_states[N_HIGH_MEMORY])) in apply_policy_zone()
1886 if (!current->il_weight || !node_isset(node, policy->nodes)) { in weighted_interleave_nodes()
1887 node = next_node_in(node, policy->nodes); in weighted_interleave_nodes()
1908 nid = next_node_in(current->il_prev, policy->nodes); in interleave_nodes()
1934 return first_node(policy->nodes); in mempolicy_slab_node()
1955 &policy->nodes); in mempolicy_slab_node()
1975 memcpy(mask, &pol->nodes, sizeof(nodemask_t)); in read_once_policy_nodemask()
2021 * node in pol->nodes (starting from ilx=0), wrapping around if ilx
2022 * exceeds the number of present nodes.
2042 * Return a nodemask representing a mempolicy for filtering nodes for
2053 *nid = first_node(pol->nodes); in policy_nodemask()
2056 nodemask = &pol->nodes; in policy_nodemask()
2063 cpuset_nodemask_valid_mems_allowed(&pol->nodes)) in policy_nodemask()
2064 nodemask = &pol->nodes; in policy_nodemask()
2146 *mask = mempolicy->nodes; in init_nodemask_of_mempolicy()
2168 * memory allocated from all nodes in system.
2184 ret = nodes_intersects(mempolicy->nodes, *mask); in mempolicy_in_oom_domain()
2198 * preferred nodes but skip the direct reclaim and allow the in alloc_pages_preferred_many()
2200 * nodes in system. in alloc_pages_preferred_many()
2239 * node and don't fall back to other nodes, as the cost of in alloc_pages_mpol_noprof()
2360 int nodes; in alloc_pages_bulk_array_interleave() local
2367 nodes = nodes_weight(pol->nodes); in alloc_pages_bulk_array_interleave()
2368 nr_pages_per_node = nr_pages / nodes; in alloc_pages_bulk_array_interleave()
2369 delta = nr_pages - nodes * nr_pages_per_node; in alloc_pages_bulk_array_interleave()
2371 for (i = 0; i < nodes; i++) { in alloc_pages_bulk_array_interleave()
2404 nodemask_t nodes; in alloc_pages_bulk_array_weighted_interleave() local
2414 /* read the nodes onto the stack, retry if done during rebind */ in alloc_pages_bulk_array_weighted_interleave()
2417 nnodes = read_once_policy_nodemask(pol, &nodes); in alloc_pages_bulk_array_weighted_interleave()
2427 if (weight && node_isset(node, nodes)) { in alloc_pages_bulk_array_weighted_interleave()
2457 for_each_node_mask(node, nodes) { in alloc_pages_bulk_array_weighted_interleave()
2472 resume_node = next_node_in(prev_node, nodes); in alloc_pages_bulk_array_weighted_interleave()
2475 node = next_node_in(prev_node, nodes); in alloc_pages_bulk_array_weighted_interleave()
2516 nr_allocated = alloc_pages_bulk_noprof(preferred_gfp, nid, &pol->nodes, in alloc_pages_bulk_array_preferred_many()
2626 return !!nodes_equal(a->nodes, b->nodes); in __mpol_equal()
2773 if (node_isset(curnid, pol->nodes)) in mpol_misplaced()
2775 polnid = first_node(pol->nodes); in mpol_misplaced()
2786 * policy nodemask we don't allow numa migration to nodes in mpol_misplaced()
2795 * Optimize placement among multiple nodes in mpol_misplaced()
2798 if (node_isset(thisnid, pol->nodes)) in mpol_misplaced()
2806 * If no allowed nodes, use current [!misplaced]. in mpol_misplaced()
2808 if (node_isset(curnid, pol->nodes)) in mpol_misplaced()
2813 &pol->nodes); in mpol_misplaced()
3108 .nodes = nodemask_of_node(nid), in numa_policy_init()
3114 * enabled across suitably sized nodes (default is >= 16MB), or in numa_policy_init()
3177 nodemask_t nodes; in mpol_parse_str() local
3188 if (nodelist_parse(nodelist, nodes)) in mpol_parse_str()
3190 if (!nodes_subset(nodes, node_states[N_MEMORY])) in mpol_parse_str()
3193 nodes_clear(nodes); in mpol_parse_str()
3203 * we use first_node(nodes) to grab a single node, so here in mpol_parse_str()
3204 * nodelist (or nodes) cannot be empty. in mpol_parse_str()
3212 if (nodes_empty(nodes)) in mpol_parse_str()
3219 * Default to online nodes with memory if no nodelist in mpol_parse_str()
3222 nodes = node_states[N_MEMORY]; in mpol_parse_str()
3261 new = mpol_new(mode, mode_flags, &nodes); in mpol_parse_str()
3266 * Save nodes for mpol_to_str() to show the tmpfs mount options in mpol_parse_str()
3270 new->nodes = nodes; in mpol_parse_str()
3272 nodes_clear(new->nodes); in mpol_parse_str()
3273 node_set(first_node(nodes), new->nodes); in mpol_parse_str()
3279 * Save nodes for contextualization: this will be used to "clone" in mpol_parse_str()
3282 new->w.user_nodemask = nodes; in mpol_parse_str()
3312 nodemask_t nodes = NODE_MASK_NONE; in mpol_to_str() local
3333 nodes = pol->nodes; in mpol_to_str()
3361 if (!nodes_empty(nodes)) in mpol_to_str()
3363 nodemask_pr_args(&nodes)); in mpol_to_str()