Lines Matching +full:non +full:- +full:exclusive

7  *  Copyright (C) 2004-2007 Silicon Graphics, Inc.
11 * sysfs is Copyright (c) 2001-3 Patrick Mochel
13 * 2003-10-10 Written by Simon Derr.
14 * 2003-10-22 Updates by Stephen Hemminger.
15 * 2004 May-July Rework by Paul Jackson.
24 #include "cpuset-internal.h"
49 * node binding, add this key to provide a quick low-cost judgment
55 [PERR_INVCPUS] = "Invalid cpu list in cpuset.cpus.exclusive",
58 [PERR_NOTEXCL] = "Cpu list in cpuset.cpus not exclusive",
61 [PERR_CPUSEMPTY] = "cpuset.cpus and cpuset.cpus.exclusive are empty",
73 * Exclusive CPUs distributed out to local or remote sub-partitions of
79 * Exclusive CPUs in isolated partitions
95 * - update_partition_sd_lb()
96 * - update_cpumasks_hier()
97 * - cpuset_update_flag()
98 * - cpuset_hotplug_update_tasks()
99 * - cpuset_handle_hotplug()
103 * Note that update_relax_domain_level() in cpuset-v1.c can still call
111 * 0 - member (not a partition root)
112 * 1 - partition root
113 * 2 - partition root without load balancing (isolated)
114 * -1 - invalid partition root
115 * -2 - invalid isolated partition root
117 * There are 2 types of partitions - local or remote. Local partitions are
119 * cpuset.cpus.exclusive are optional in setting up local partitions.
121 * down exclusive CPUs by setting cpuset.cpus.exclusive along its ancestor
131 #define PRS_INVALID_ROOT -1
132 #define PRS_INVALID_ISOLATED -2
152 cs->nr_deadline_tasks++; in inc_dl_tasks_cs()
159 cs->nr_deadline_tasks--; in dec_dl_tasks_cs()
164 return cs->partition_root_state > 0; in is_partition_valid()
169 return cs->partition_root_state < 0; in is_partition_invalid()
177 if (cs->partition_root_state > 0) in make_partition_invalid()
178 cs->partition_root_state = -cs->partition_root_state; in make_partition_invalid()
186 if (old_prs == cs->partition_root_state) in notify_partition_change()
188 cgroup_file_notify(&cs->partition_file); in notify_partition_change()
192 WRITE_ONCE(cs->prs_err, PERR_NONE); in notify_partition_change()
213 .relax_domain_level = -1,
218 * There are two global locks guarding cpuset structures - cpuset_mutex and
222 * paths that rely on priority inheritance (e.g. scheduler - on RT) for
239 * If a task is only holding callback_lock, then it has read-only
247 * small pieces of code, such as when reading out possibly multi-word
291 * decrease cs->attach_in_progress.
292 * wake_up cpuset_attach_wq if cs->attach_in_progress==0.
298 cs->attach_in_progress--; in dec_attach_in_progress_locked()
299 if (!cs->attach_in_progress) in dec_attach_in_progress_locked()
327 (cpuset_cgrp_subsys.root->flags & CGRP_ROOT_CPUSET_V2_MODE); in is_in_v2_mode()
331 * partition_is_populated - check if partition has tasks
337 * be non-NULL when this cpuset is going to become a partition itself.
345 if (cs->css.cgroup->nr_populated_csets) in partition_is_populated()
347 if (!excluded_child && !cs->nr_subparts) in partition_is_populated()
348 return cgroup_is_populated(cs->css.cgroup); in partition_is_populated()
356 if (cgroup_is_populated(child->css.cgroup)) { in partition_is_populated()
371 * One way or another, we guarantee to return some non-empty subset
388 while (!cpumask_intersects(cs->effective_cpus, pmask)) in guarantee_active_cpus()
391 cpumask_and(pmask, pmask, cs->effective_cpus); in guarantee_active_cpus()
401 * One way or another, we guarantee to return some non-empty subset
408 while (!nodes_intersects(cs->effective_mems, node_states[N_MEMORY])) in guarantee_online_mems()
410 nodes_and(*pmask, cs->effective_mems, node_states[N_MEMORY]); in guarantee_online_mems()
414 * alloc_cpumasks - allocate three cpumasks for cpuset
417 * Return: 0 if successful, -ENOMEM otherwise.
419 * Only one of the two input arguments should be non-NULL.
426 pmask1 = &cs->cpus_allowed; in alloc_cpumasks()
427 pmask2 = &cs->effective_cpus; in alloc_cpumasks()
428 pmask3 = &cs->effective_xcpus; in alloc_cpumasks()
429 pmask4 = &cs->exclusive_cpus; in alloc_cpumasks()
431 pmask1 = &tmp->new_cpus; in alloc_cpumasks()
432 pmask2 = &tmp->addmask; in alloc_cpumasks()
433 pmask3 = &tmp->delmask; in alloc_cpumasks()
438 return -ENOMEM; in alloc_cpumasks()
458 return -ENOMEM; in alloc_cpumasks()
462 * free_cpumasks - free cpumasks in a tmpmasks structure
469 free_cpumask_var(cs->cpus_allowed); in free_cpumasks()
470 free_cpumask_var(cs->effective_cpus); in free_cpumasks()
471 free_cpumask_var(cs->effective_xcpus); in free_cpumasks()
472 free_cpumask_var(cs->exclusive_cpus); in free_cpumasks()
475 free_cpumask_var(tmp->new_cpus); in free_cpumasks()
476 free_cpumask_var(tmp->addmask); in free_cpumasks()
477 free_cpumask_var(tmp->delmask); in free_cpumasks()
482 * alloc_trial_cpuset - allocate a trial cpuset
498 cpumask_copy(trial->cpus_allowed, cs->cpus_allowed); in alloc_trial_cpuset()
499 cpumask_copy(trial->effective_cpus, cs->effective_cpus); in alloc_trial_cpuset()
500 cpumask_copy(trial->effective_xcpus, cs->effective_xcpus); in alloc_trial_cpuset()
501 cpumask_copy(trial->exclusive_cpus, cs->exclusive_cpus); in alloc_trial_cpuset()
506 * free_cpuset - free the cpuset
515 /* Return user specified exclusive CPUs */
518 return cpumask_empty(cs->exclusive_cpus) ? cs->cpus_allowed in user_xcpus()
519 : cs->exclusive_cpus; in user_xcpus()
524 return cpumask_empty(cs->cpus_allowed) && in xcpus_empty()
525 cpumask_empty(cs->exclusive_cpus); in xcpus_empty()
529 * cpusets_are_exclusive() - check if two cpusets are exclusive
531 * Return true if exclusive, false if not
544 * validate_change() - Used to validate that any proposed cpuset change
549 * our various subset and exclusive rules still be valid? Presumes
552 * 'cur' is the address of an actual, in-use cpuset. Operations
560 * Return 0 if valid, -errno if not.
583 * Cpusets with tasks - existing or newly being attached - can't in validate_change()
586 ret = -ENOSPC; in validate_change()
587 if ((cgroup_is_populated(cur->css.cgroup) || cur->attach_in_progress)) { in validate_change()
588 if (!cpumask_empty(cur->cpus_allowed) && in validate_change()
589 cpumask_empty(trial->cpus_allowed)) in validate_change()
591 if (!nodes_empty(cur->mems_allowed) && in validate_change()
592 nodes_empty(trial->mems_allowed)) in validate_change()
605 * for non-isolated partition root. At this point, the target in validate_change()
613 ret = -EBUSY; in validate_change()
615 !cpuset_cpumask_can_shrink(cur->effective_cpus, user_xcpus(trial))) in validate_change()
619 * If either I or some sibling (!= me) is exclusive, we can't in validate_change()
622 ret = -EINVAL; in validate_change()
629 txset = !cpumask_empty(trial->exclusive_cpus); in validate_change()
630 cxset = !cpumask_empty(c->exclusive_cpus); in validate_change()
642 * available if these exclusive CPUs are activated. in validate_change()
645 xcpus = trial->exclusive_cpus; in validate_change()
646 acpus = c->cpus_allowed; in validate_change()
648 xcpus = c->exclusive_cpus; in validate_change()
649 acpus = trial->cpus_allowed; in validate_change()
655 nodes_intersects(trial->mems_allowed, c->mems_allowed)) in validate_change()
672 return cpumask_intersects(a->effective_cpus, b->effective_cpus); in cpusets_overlap()
678 if (dattr->relax_domain_level < c->relax_domain_level) in update_domain_attr()
679 dattr->relax_domain_level = c->relax_domain_level; in update_domain_attr()
692 if (cpumask_empty(cp->cpus_allowed)) { in update_domain_attr_tree()
706 /* jump label reference count + the top-level cpuset */ in nr_cpusets()
714 * A 'partial partition' is a set of non-overlapping subsets whose
721 * See "What is sched_load_balance" in Documentation/admin-guide/cgroup-v1/cpusets.rst
732 * cp - cpuset pointer, used (together with pos_css) to perform a
733 * top-down scan of all cpusets. For our purposes, rebuilding
736 * csa - (for CpuSet Array) Array of pointers to all the cpusets
743 * doms - Conversion of 'csa' to an array of cpumasks, for passing to
753 * and merging them using a union-find algorithm.
763 struct cpuset *cp; /* top-down scan of cpusets */ in generate_sched_domains()
823 if (!cpumask_empty(cp->cpus_allowed) && in generate_sched_domains()
825 cpumask_intersects(cp->cpus_allowed, in generate_sched_domains()
830 !cpumask_empty(cp->effective_cpus)) in generate_sched_domains()
840 * non-empty effective_cpus will be saved into csn[]. in generate_sched_domains()
842 if ((cp->partition_root_state == PRS_ROOT) && in generate_sched_domains()
843 !cpumask_empty(cp->effective_cpus)) in generate_sched_domains()
848 * exclusive CPUs to be granted to child cpusets. in generate_sched_domains()
850 if (!is_partition_valid(cp) && cpumask_empty(cp->exclusive_cpus)) in generate_sched_domains()
863 uf_node_init(&csa[i]->node); in generate_sched_domains()
874 uf_union(&csa[i]->node, &csa[j]->node); in generate_sched_domains()
881 if (uf_find(&csa[i]->node) == &csa[i]->node) in generate_sched_domains()
902 * to SD_ATTR_INIT. Also non-isolating partition root CPUs are a in generate_sched_domains()
912 cpumask_and(doms[i], csa[i]->effective_cpus, in generate_sched_domains()
915 cpumask_copy(doms[i], csa[i]->effective_cpus); in generate_sched_domains()
925 if (uf_find(&csa[j]->node) == &csa[i]->node) { in generate_sched_domains()
934 cpumask_or(dp, dp, csa[j]->effective_cpus); in generate_sched_domains()
965 if (cs->nr_deadline_tasks == 0) in dl_update_tasks_root_domain()
968 css_task_iter_start(&cs->css, 0, &it); in dl_update_tasks_root_domain()
998 if (cpumask_empty(cs->effective_cpus)) { in dl_rebuild_rd_accounting()
1003 css_get(&cs->css); in dl_rebuild_rd_accounting()
1010 css_put(&cs->css); in dl_rebuild_rd_accounting()
1018 * If the flag 'sched_load_balance' of any cpuset with non-empty
1020 * which has that flag enabled, or if any cpuset with a non-empty
1063 if (!cpumask_subset(cs->effective_cpus, in rebuild_sched_domains_locked()
1106 * cpuset_update_tasks_cpumask - Update the cpumasks of tasks in the cpuset.
1127 css_task_iter_start(&cs->css, 0, &it); in cpuset_update_tasks_cpumask()
1137 if (task->flags & PF_NO_SETAFFINITY) in cpuset_update_tasks_cpumask()
1141 cpumask_and(new_cpus, possible_mask, cs->effective_cpus); in cpuset_update_tasks_cpumask()
1149 * compute_effective_cpumask - Compute the effective cpumask of the cpuset
1159 cpumask_and(new_cpus, cs->cpus_allowed, parent->effective_cpus); in compute_effective_cpumask()
1177 * Update partition exclusive flag
1183 bool exclusive = (new_prs > PRS_MEMBER); in update_partition_exclusive_flag() local
1185 if (exclusive && !is_cpu_exclusive(cs)) { in update_partition_exclusive_flag()
1188 } else if (!exclusive && is_cpu_exclusive(cs)) { in update_partition_exclusive_flag()
1204 int new_prs = cs->partition_root_state; in update_partition_sd_lb()
1220 set_bit(CS_SCHED_LOAD_BALANCE, &cs->flags); in update_partition_sd_lb()
1222 clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags); in update_partition_sd_lb()
1230 * tasks_nocpu_error - Return true if tasks will have no effective_cpus
1238 return (cpumask_subset(parent->effective_cpus, xcpus) && in tasks_nocpu_error()
1253 cs->nr_subparts = 0; in reset_partition_data()
1254 if (cpumask_empty(cs->exclusive_cpus)) { in reset_partition_data()
1255 cpumask_clear(cs->effective_xcpus); in reset_partition_data()
1257 clear_bit(CS_CPU_EXCLUSIVE, &cs->flags); in reset_partition_data()
1259 if (!cpumask_and(cs->effective_cpus, parent->effective_cpus, cs->cpus_allowed)) in reset_partition_data()
1260 cpumask_copy(cs->effective_cpus, parent->effective_cpus); in reset_partition_data()
1264 * isolated_cpus_update - Update the isolated_cpus mask
1267 * @xcpus: exclusive CPUs with state change
1279 * partition_xcpus_add - Add new exclusive CPUs to partition
1282 * @xcpus: exclusive CPUs to be added
1301 isolcpus_updated = (new_prs != parent->partition_root_state); in partition_xcpus_add()
1303 isolated_cpus_update(parent->partition_root_state, new_prs, in partition_xcpus_add()
1306 cpumask_andnot(parent->effective_cpus, parent->effective_cpus, xcpus); in partition_xcpus_add()
1311 * partition_xcpus_del - Remove exclusive CPUs from partition
1314 * @xcpus: exclusive CPUs to be removed
1332 isolcpus_updated = (old_prs != parent->partition_root_state); in partition_xcpus_del()
1334 isolated_cpus_update(old_prs, parent->partition_root_state, in partition_xcpus_del()
1338 cpumask_or(parent->effective_cpus, parent->effective_cpus, xcpus); in partition_xcpus_del()
1356 * cpuset_cpu_is_isolated - Check if the given CPU is isolated
1367 * compute_effective_exclusive_cpumask - compute effective exclusive CPUs
1369 * @xcpus: effective exclusive CPUs value to be set
1388 xcpus = cs->effective_xcpus; in compute_effective_exclusive_cpumask()
1390 cpumask_and(xcpus, user_xcpus(cs), parent->effective_xcpus); in compute_effective_exclusive_cpumask()
1393 if (!cpumask_empty(cs->exclusive_cpus)) in compute_effective_exclusive_cpumask()
1400 * Exclude exclusive CPUs from siblings in compute_effective_exclusive_cpumask()
1407 if (cpumask_intersects(xcpus, sibling->exclusive_cpus)) { in compute_effective_exclusive_cpumask()
1408 cpumask_andnot(xcpus, xcpus, sibling->exclusive_cpus); in compute_effective_exclusive_cpumask()
1412 if (cpumask_intersects(xcpus, sibling->effective_xcpus)) { in compute_effective_exclusive_cpumask()
1413 cpumask_andnot(xcpus, xcpus, sibling->effective_xcpus); in compute_effective_exclusive_cpumask()
1423 return !list_empty(&cs->remote_sibling); in is_remote_partition()
1432 * remote_partition_enable - Enable current cpuset as a remote partition root
1462 compute_effective_exclusive_cpumask(cs, tmp->new_cpus, NULL); in remote_partition_enable()
1463 WARN_ON_ONCE(cpumask_intersects(tmp->new_cpus, subpartitions_cpus)); in remote_partition_enable()
1464 if (!cpumask_intersects(tmp->new_cpus, cpu_active_mask) || in remote_partition_enable()
1465 cpumask_subset(top_cpuset.effective_cpus, tmp->new_cpus)) in remote_partition_enable()
1469 isolcpus_updated = partition_xcpus_add(new_prs, NULL, tmp->new_cpus); in remote_partition_enable()
1470 list_add(&cs->remote_sibling, &remote_children); in remote_partition_enable()
1471 cpumask_copy(cs->effective_xcpus, tmp->new_cpus); in remote_partition_enable()
1475 cs->prs_err = 0; in remote_partition_enable()
1480 cpuset_update_tasks_cpumask(&top_cpuset, tmp->new_cpus); in remote_partition_enable()
1486 * remote_partition_disable - Remove current cpuset from remote partition list
1499 WARN_ON_ONCE(!cpumask_subset(cs->effective_xcpus, subpartitions_cpus)); in remote_partition_disable()
1502 list_del_init(&cs->remote_sibling); in remote_partition_disable()
1503 isolcpus_updated = partition_xcpus_del(cs->partition_root_state, in remote_partition_disable()
1504 NULL, cs->effective_xcpus); in remote_partition_disable()
1505 if (cs->prs_err) in remote_partition_disable()
1506 cs->partition_root_state = -cs->partition_root_state; in remote_partition_disable()
1508 cs->partition_root_state = PRS_MEMBER; in remote_partition_disable()
1520 cpuset_update_tasks_cpumask(&top_cpuset, tmp->new_cpus); in remote_partition_disable()
1525 * remote_cpus_update - cpus_exclusive change of remote partition
1527 * @xcpus: the new exclusive_cpus mask, if non-NULL
1538 int prs = cs->partition_root_state; in remote_cpus_update()
1544 WARN_ON_ONCE(!cpumask_subset(cs->effective_xcpus, subpartitions_cpus)); in remote_cpus_update()
1547 cs->prs_err = PERR_CPUSEMPTY; in remote_cpus_update()
1551 adding = cpumask_andnot(tmp->addmask, excpus, cs->effective_xcpus); in remote_cpus_update()
1552 deleting = cpumask_andnot(tmp->delmask, cs->effective_xcpus, excpus); in remote_cpus_update()
1560 WARN_ON_ONCE(cpumask_intersects(tmp->addmask, subpartitions_cpus)); in remote_cpus_update()
1562 cs->prs_err = PERR_ACCESS; in remote_cpus_update()
1563 else if (cpumask_intersects(tmp->addmask, subpartitions_cpus) || in remote_cpus_update()
1564 cpumask_subset(top_cpuset.effective_cpus, tmp->addmask)) in remote_cpus_update()
1565 cs->prs_err = PERR_NOCPUS; in remote_cpus_update()
1566 if (cs->prs_err) in remote_cpus_update()
1572 isolcpus_updated += partition_xcpus_add(prs, NULL, tmp->addmask); in remote_cpus_update()
1574 isolcpus_updated += partition_xcpus_del(prs, NULL, tmp->delmask); in remote_cpus_update()
1579 cpumask_copy(cs->effective_xcpus, excpus); in remote_cpus_update()
1581 cpumask_copy(cs->exclusive_cpus, xcpus); in remote_cpus_update()
1590 cpuset_update_tasks_cpumask(&top_cpuset, tmp->new_cpus); in remote_cpus_update()
1599 * prstate_housekeeping_conflict - check for partition & housekeeping conflicts
1619 * update_parent_effective_cpumask - update effective_cpus mask of parent cpuset
1626 * For partcmd_enable*, the cpuset is being transformed from a non-partition
1633 * root back to a non-partition root. Any CPUs in effective_xcpus will be
1677 old_prs = new_prs = cs->partition_root_state; in update_parent_effective_cpumask()
1687 adding = cpumask_and(tmp->addmask, in update_parent_effective_cpumask()
1688 xcpus, parent->effective_xcpus); in update_parent_effective_cpumask()
1690 new_prs = -old_prs; in update_parent_effective_cpumask()
1691 subparts_delta--; in update_parent_effective_cpumask()
1716 xcpus = tmp->delmask; in update_parent_effective_cpumask()
1718 WARN_ON_ONCE(!cpumask_empty(cs->exclusive_cpus)); in update_parent_effective_cpumask()
1742 * (cs->effective_xcpus & cpu_active_mask) ⊆ parent->effective_cpus in update_parent_effective_cpumask()
1746 cpumask_and(tmp->new_cpus, xcpus, cpu_active_mask); in update_parent_effective_cpumask()
1747 WARN_ON_ONCE(!cpumask_subset(tmp->new_cpus, parent->effective_cpus)); in update_parent_effective_cpumask()
1760 cpumask_copy(tmp->addmask, cs->effective_xcpus); in update_parent_effective_cpumask()
1762 subparts_delta--; in update_parent_effective_cpumask()
1784 * & parent->effective_xcpus in update_parent_effective_cpumask()
1786 * & parent->effective_xcpus in update_parent_effective_cpumask()
1789 * delmask = newmask & parent->effective_xcpus in update_parent_effective_cpumask()
1793 deleting = cpumask_and(tmp->delmask, in update_parent_effective_cpumask()
1794 newmask, parent->effective_xcpus); in update_parent_effective_cpumask()
1796 cpumask_andnot(tmp->addmask, xcpus, newmask); in update_parent_effective_cpumask()
1797 adding = cpumask_and(tmp->addmask, tmp->addmask, in update_parent_effective_cpumask()
1798 parent->effective_xcpus); in update_parent_effective_cpumask()
1800 cpumask_andnot(tmp->delmask, newmask, xcpus); in update_parent_effective_cpumask()
1801 deleting = cpumask_and(tmp->delmask, tmp->delmask, in update_parent_effective_cpumask()
1802 parent->effective_xcpus); in update_parent_effective_cpumask()
1809 cpumask_and(tmp->new_cpus, tmp->delmask, cpu_active_mask); in update_parent_effective_cpumask()
1810 WARN_ON_ONCE(!cpumask_subset(tmp->new_cpus, parent->effective_cpus)); in update_parent_effective_cpumask()
1818 !cpumask_intersects(tmp->addmask, cpu_active_mask))) { in update_parent_effective_cpumask()
1821 adding = cpumask_and(tmp->addmask, in update_parent_effective_cpumask()
1822 xcpus, parent->effective_xcpus); in update_parent_effective_cpumask()
1828 * delmask = effective_xcpus & parent->effective_cpus in update_parent_effective_cpumask()
1844 adding = cpumask_and(tmp->addmask, in update_parent_effective_cpumask()
1845 xcpus, parent->effective_xcpus); in update_parent_effective_cpumask()
1847 cpumask_subset(xcpus, parent->effective_xcpus)) { in update_parent_effective_cpumask()
1850 bool exclusive = true; in update_parent_effective_cpumask() local
1861 exclusive = false; in update_parent_effective_cpumask()
1866 if (exclusive) in update_parent_effective_cpumask()
1867 deleting = cpumask_and(tmp->delmask, in update_parent_effective_cpumask()
1868 xcpus, parent->effective_cpus); in update_parent_effective_cpumask()
1876 WRITE_ONCE(cs->prs_err, part_error); in update_parent_effective_cpumask()
1883 switch (cs->partition_root_state) { in update_parent_effective_cpumask()
1887 new_prs = -old_prs; in update_parent_effective_cpumask()
1888 subparts_delta--; in update_parent_effective_cpumask()
1894 new_prs = -old_prs; in update_parent_effective_cpumask()
1926 cs->partition_root_state = new_prs; in update_parent_effective_cpumask()
1928 cs->nr_subparts = 0; in update_parent_effective_cpumask()
1936 tmp->addmask); in update_parent_effective_cpumask()
1939 tmp->delmask); in update_parent_effective_cpumask()
1942 parent->nr_subparts += subparts_delta; in update_parent_effective_cpumask()
1943 WARN_ON_ONCE(parent->nr_subparts < 0); in update_parent_effective_cpumask()
1952 cpuset_update_tasks_cpumask(parent, tmp->addmask); in update_parent_effective_cpumask()
1969 * compute_partition_effective_cpumask - compute effective_cpus for partition
2012 child->prs_err = 0; in compute_partition_effective_cpumask()
2013 if (!cpumask_subset(child->effective_xcpus, in compute_partition_effective_cpumask()
2014 cs->effective_xcpus)) in compute_partition_effective_cpumask()
2015 child->prs_err = PERR_INVCPUS; in compute_partition_effective_cpumask()
2017 cpumask_subset(new_ecpus, child->effective_xcpus)) in compute_partition_effective_cpumask()
2018 child->prs_err = PERR_NOCPUS; in compute_partition_effective_cpumask()
2020 if (child->prs_err) { in compute_partition_effective_cpumask()
2021 int old_prs = child->partition_root_state; in compute_partition_effective_cpumask()
2028 cs->nr_subparts--; in compute_partition_effective_cpumask()
2029 child->nr_subparts = 0; in compute_partition_effective_cpumask()
2035 child->effective_xcpus); in compute_partition_effective_cpumask()
2041 * update_cpumasks_hier - Update effective cpumasks and tasks in the subtree
2067 old_prs = new_prs = cp->partition_root_state; in update_cpumasks_hier()
2074 * remote_cpus_update() will reuse tmp->new_cpus only after in update_cpumasks_hier()
2078 compute_effective_exclusive_cpumask(cp, tmp->new_cpus, NULL); in update_cpumasks_hier()
2079 if (cpumask_equal(cp->effective_xcpus, tmp->new_cpus)) { in update_cpumasks_hier()
2084 remote_cpus_update(cp, NULL, tmp->new_cpus, tmp); in update_cpumasks_hier()
2088 new_prs = cp->partition_root_state; in update_cpumasks_hier()
2093 compute_partition_effective_cpumask(cp, tmp->new_cpus); in update_cpumasks_hier()
2095 compute_effective_cpumask(tmp->new_cpus, cp, parent); in update_cpumasks_hier()
2105 if (is_partition_valid(cp) && cpumask_empty(tmp->new_cpus)) { in update_cpumasks_hier()
2116 if (is_in_v2_mode() && !remote && cpumask_empty(tmp->new_cpus)) in update_cpumasks_hier()
2117 cpumask_copy(tmp->new_cpus, parent->effective_cpus); in update_cpumasks_hier()
2126 if (!cp->partition_root_state && !force && in update_cpumasks_hier()
2127 cpumask_equal(tmp->new_cpus, cp->effective_cpus) && in update_cpumasks_hier()
2142 switch (parent->partition_root_state) { in update_cpumasks_hier()
2155 new_prs = -cp->partition_root_state; in update_cpumasks_hier()
2156 WRITE_ONCE(cp->prs_err, in update_cpumasks_hier()
2163 if (!css_tryget_online(&cp->css)) in update_cpumasks_hier()
2173 new_prs = cp->partition_root_state; in update_cpumasks_hier()
2177 cpumask_copy(cp->effective_cpus, tmp->new_cpus); in update_cpumasks_hier()
2178 cp->partition_root_state = new_prs; in update_cpumasks_hier()
2179 if (!cpumask_empty(cp->exclusive_cpus) && (cp != cs)) in update_cpumasks_hier()
2186 if ((new_prs > 0) && cpumask_empty(cp->exclusive_cpus)) in update_cpumasks_hier()
2187 cpumask_and(cp->effective_xcpus, in update_cpumasks_hier()
2188 cp->cpus_allowed, parent->effective_xcpus); in update_cpumasks_hier()
2196 !cpumask_equal(cp->cpus_allowed, cp->effective_cpus)); in update_cpumasks_hier()
2198 cpuset_update_tasks_cpumask(cp, cp->effective_cpus); in update_cpumasks_hier()
2208 set_bit(CS_SCHED_LOAD_BALANCE, &cp->flags); in update_cpumasks_hier()
2210 clear_bit(CS_SCHED_LOAD_BALANCE, &cp->flags); in update_cpumasks_hier()
2214 * On legacy hierarchy, if the effective cpumask of any non- in update_cpumasks_hier()
2219 if (!cpumask_empty(cp->cpus_allowed) && in update_cpumasks_hier()
2225 css_put(&cp->css); in update_cpumasks_hier()
2234 * update_sibling_cpumasks - Update siblings cpumasks
2264 compute_effective_cpumask(tmp->new_cpus, sibling, in update_sibling_cpumasks()
2266 if (cpumask_equal(tmp->new_cpus, sibling->effective_cpus)) in update_sibling_cpumasks()
2276 if (!css_tryget_online(&sibling->css)) in update_sibling_cpumasks()
2282 css_put(&sibling->css); in update_sibling_cpumasks()
2288 * update_cpumask - update the cpus_allowed mask of a cpuset and all tasks in it
2301 int old_prs = cs->partition_root_state; in update_cpumask()
2303 /* top_cpuset.cpus_allowed tracks cpu_active_mask; it's read-only */ in update_cpumask()
2305 return -EACCES; in update_cpumask()
2314 cpumask_clear(trialcs->cpus_allowed); in update_cpumask()
2315 if (cpumask_empty(trialcs->exclusive_cpus)) in update_cpumask()
2316 cpumask_clear(trialcs->effective_xcpus); in update_cpumask()
2318 retval = cpulist_parse(buf, trialcs->cpus_allowed); in update_cpumask()
2322 if (!cpumask_subset(trialcs->cpus_allowed, in update_cpumask()
2324 return -EINVAL; in update_cpumask()
2329 * trialcs->effective_xcpus is used as a temporary cpumask in update_cpumask()
2332 trialcs->partition_root_state = PRS_MEMBER; in update_cpumask()
2333 if (!cpumask_empty(trialcs->exclusive_cpus) || is_partition_valid(cs)) in update_cpumask()
2338 if (cpumask_equal(cs->cpus_allowed, trialcs->cpus_allowed)) in update_cpumask()
2342 return -ENOMEM; in update_cpumask()
2346 cpumask_empty(trialcs->effective_xcpus)) { in update_cpumask()
2348 cs->prs_err = PERR_INVCPUS; in update_cpumask()
2349 } else if (prstate_housekeeping_conflict(old_prs, trialcs->effective_xcpus)) { in update_cpumask()
2351 cs->prs_err = PERR_HKEEPING; in update_cpumask()
2352 } else if (tasks_nocpu_error(parent, cs, trialcs->effective_xcpus)) { in update_cpumask()
2354 cs->prs_err = PERR_NOCPUS; in update_cpumask()
2362 force = !cpumask_equal(cs->effective_xcpus, trialcs->effective_xcpus); in update_cpumask()
2366 if ((retval == -EINVAL) && cpuset_v2()) { in update_cpumask()
2371 * The -EINVAL error code indicates that partition sibling in update_cpumask()
2383 cpumask_intersects(xcpus, cp->effective_xcpus)) { in update_cpumask()
2398 struct cpumask *xcpus = trialcs->effective_xcpus; in update_cpumask()
2401 xcpus = trialcs->cpus_allowed; in update_cpumask()
2417 cpumask_copy(cs->cpus_allowed, trialcs->cpus_allowed); in update_cpumask()
2418 cpumask_copy(cs->effective_xcpus, trialcs->effective_xcpus); in update_cpumask()
2427 if (cs->partition_root_state) in update_cpumask()
2435 * update_exclusive_cpumask - update the exclusive_cpus mask of a cpuset
2450 int old_prs = cs->partition_root_state; in update_exclusive_cpumask()
2453 cpumask_clear(trialcs->exclusive_cpus); in update_exclusive_cpumask()
2454 cpumask_clear(trialcs->effective_xcpus); in update_exclusive_cpumask()
2456 retval = cpulist_parse(buf, trialcs->exclusive_cpus); in update_exclusive_cpumask()
2462 if (cpumask_equal(cs->exclusive_cpus, trialcs->exclusive_cpus)) in update_exclusive_cpumask()
2466 trialcs->partition_root_state = PRS_MEMBER; in update_exclusive_cpumask()
2468 * Reject the change if there is exclusive CPUs conflict with in update_exclusive_cpumask()
2472 return -EINVAL; in update_exclusive_cpumask()
2479 force = !cpumask_equal(cs->effective_xcpus, trialcs->effective_xcpus); in update_exclusive_cpumask()
2486 return -ENOMEM; in update_exclusive_cpumask()
2489 if (cpumask_empty(trialcs->effective_xcpus)) { in update_exclusive_cpumask()
2491 cs->prs_err = PERR_INVCPUS; in update_exclusive_cpumask()
2492 } else if (prstate_housekeeping_conflict(old_prs, trialcs->effective_xcpus)) { in update_exclusive_cpumask()
2494 cs->prs_err = PERR_HKEEPING; in update_exclusive_cpumask()
2495 } else if (tasks_nocpu_error(parent, cs, trialcs->effective_xcpus)) { in update_exclusive_cpumask()
2497 cs->prs_err = PERR_NOCPUS; in update_exclusive_cpumask()
2504 remote_cpus_update(cs, trialcs->exclusive_cpus, in update_exclusive_cpumask()
2505 trialcs->effective_xcpus, &tmp); in update_exclusive_cpumask()
2511 trialcs->effective_xcpus, &tmp); in update_exclusive_cpumask()
2515 cpumask_copy(cs->exclusive_cpus, trialcs->exclusive_cpus); in update_exclusive_cpumask()
2516 cpumask_copy(cs->effective_xcpus, trialcs->effective_xcpus); in update_exclusive_cpumask()
2530 if (cs->partition_root_state) in update_exclusive_cpumask()
2558 do_migrate_pages(mwork->mm, &mwork->from, &mwork->to, MPOL_MF_MOVE_ALL); in cpuset_migrate_mm_workfn()
2559 mmput(mwork->mm); in cpuset_migrate_mm_workfn()
2575 mwork->mm = mm; in cpuset_migrate_mm()
2576 mwork->from = *from; in cpuset_migrate_mm()
2577 mwork->to = *to; in cpuset_migrate_mm()
2578 INIT_WORK(&mwork->work, cpuset_migrate_mm_workfn); in cpuset_migrate_mm()
2579 queue_work(cpuset_migrate_mm_wq, &mwork->work); in cpuset_migrate_mm()
2591 * cpuset_change_task_nodemask - change task's mems_allowed and mempolicy
2595 * We use the mems_allowed_seq seqlock to safely update both tsk->mems_allowed
2606 write_seqcount_begin(&tsk->mems_allowed_seq); in cpuset_change_task_nodemask()
2608 nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); in cpuset_change_task_nodemask()
2610 tsk->mems_allowed = *newmems; in cpuset_change_task_nodemask()
2612 write_seqcount_end(&tsk->mems_allowed_seq); in cpuset_change_task_nodemask()
2621 * cpuset_update_tasks_nodemask - Update the nodemasks of tasks in the cpuset.
2640 * take while holding tasklist_lock. Forks can happen - the in cpuset_update_tasks_nodemask()
2648 css_task_iter_start(&cs->css, 0, &it); in cpuset_update_tasks_nodemask()
2661 mpol_rebind_mm(mm, &cs->mems_allowed); in cpuset_update_tasks_nodemask()
2663 cpuset_migrate_mm(mm, &cs->old_mems_allowed, &newmems); in cpuset_update_tasks_nodemask()
2671 * cs->old_mems_allowed. in cpuset_update_tasks_nodemask()
2673 cs->old_mems_allowed = newmems; in cpuset_update_tasks_nodemask()
2680 * update_nodemasks_hier - Update effective nodemasks and tasks in the subtree
2700 nodes_and(*new_mems, cp->mems_allowed, parent->effective_mems); in update_nodemasks_hier()
2707 *new_mems = parent->effective_mems; in update_nodemasks_hier()
2710 if (nodes_equal(*new_mems, cp->effective_mems)) { in update_nodemasks_hier()
2715 if (!css_tryget_online(&cp->css)) in update_nodemasks_hier()
2720 cp->effective_mems = *new_mems; in update_nodemasks_hier()
2724 !nodes_equal(cp->mems_allowed, cp->effective_mems)); in update_nodemasks_hier()
2729 css_put(&cp->css); in update_nodemasks_hier()
2744 * lock each such tasks mm->mmap_lock, scan its vma's and rebind
2754 * it's read-only in update_nodemask()
2757 retval = -EACCES; in update_nodemask()
2768 nodes_clear(trialcs->mems_allowed); in update_nodemask()
2770 retval = nodelist_parse(buf, trialcs->mems_allowed); in update_nodemask()
2774 if (!nodes_subset(trialcs->mems_allowed, in update_nodemask()
2776 retval = -EINVAL; in update_nodemask()
2781 if (nodes_equal(cs->mems_allowed, trialcs->mems_allowed)) { in update_nodemask()
2782 retval = 0; /* Too easy - nothing to do */ in update_nodemask()
2789 check_insane_mems_config(&trialcs->mems_allowed); in update_nodemask()
2792 cs->mems_allowed = trialcs->mems_allowed; in update_nodemask()
2795 /* use trialcs->mems_allowed as a temp variable */ in update_nodemask()
2796 update_nodemasks_hier(cs, &trialcs->mems_allowed); in update_nodemask()
2813 * cpuset_update_flag - read a 0 or a 1 in a file and update associated flag
2831 return -ENOMEM; in cpuset_update_flag()
2834 set_bit(bit, &trialcs->flags); in cpuset_update_flag()
2836 clear_bit(bit, &trialcs->flags); in cpuset_update_flag()
2849 cs->flags = trialcs->flags; in cpuset_update_flag()
2852 if (!cpumask_empty(trialcs->cpus_allowed) && balance_flag_changed) { in cpuset_update_flag()
2867 * update_prstate - update partition_root_state
2876 int err = PERR_NONE, old_prs = cs->partition_root_state; in update_prstate()
2891 return -ENOMEM; in update_prstate()
2914 cpumask_intersects(cs->exclusive_cpus, subpartitions_cpus)) { in update_prstate()
2959 new_prs = -new_prs; in update_prstate()
2964 cs->partition_root_state = new_prs; in update_prstate()
2965 WRITE_ONCE(cs->prs_err, err); in update_prstate()
2969 isolated_cpus_update(old_prs, new_prs, cs->effective_xcpus); in update_prstate()
2978 && cpumask_empty(cs->effective_xcpus)); in update_prstate()
3000 if (cpumask_empty(cs->effective_cpus) || in cpuset_can_attach_check()
3001 (!is_in_v2_mode() && nodes_empty(cs->mems_allowed))) in cpuset_can_attach_check()
3002 return -ENOSPC; in cpuset_can_attach_check()
3008 cs->nr_migrate_dl_tasks = 0; in reset_migrate_dl_data()
3009 cs->sum_migrate_dl_bw = 0; in reset_migrate_dl_data()
3033 cpus_updated = !cpumask_equal(cs->effective_cpus, oldcs->effective_cpus); in cpuset_can_attach()
3034 mems_updated = !nodes_equal(cs->effective_mems, oldcs->effective_mems); in cpuset_can_attach()
3053 cs->nr_migrate_dl_tasks++; in cpuset_can_attach()
3054 cs->sum_migrate_dl_bw += task->dl.dl_bw; in cpuset_can_attach()
3058 if (!cs->nr_migrate_dl_tasks) in cpuset_can_attach()
3061 if (!cpumask_intersects(oldcs->effective_cpus, cs->effective_cpus)) { in cpuset_can_attach()
3062 int cpu = cpumask_any_and(cpu_active_mask, cs->effective_cpus); in cpuset_can_attach()
3066 ret = -EINVAL; in cpuset_can_attach()
3070 ret = dl_bw_alloc(cpu, cs->sum_migrate_dl_bw); in cpuset_can_attach()
3082 cs->attach_in_progress++; in cpuset_can_attach()
3099 if (cs->nr_migrate_dl_tasks) { in cpuset_cancel_attach()
3100 int cpu = cpumask_any(cs->effective_cpus); in cpuset_cancel_attach()
3102 dl_bw_free(cpu, cs->sum_migrate_dl_bw); in cpuset_cancel_attach()
3150 cpus_updated = !cpumask_equal(cs->effective_cpus, in cpuset_attach()
3151 oldcs->effective_cpus); in cpuset_attach()
3152 mems_updated = !nodes_equal(cs->effective_mems, oldcs->effective_mems); in cpuset_attach()
3161 cpuset_attach_nodemask_to = cs->effective_mems; in cpuset_attach()
3176 cpuset_attach_nodemask_to = cs->effective_mems; in cpuset_attach()
3195 cpuset_migrate_mm(mm, &oldcs->old_mems_allowed, in cpuset_attach()
3203 cs->old_mems_allowed = cpuset_attach_nodemask_to; in cpuset_attach()
3205 if (cs->nr_migrate_dl_tasks) { in cpuset_attach()
3206 cs->nr_deadline_tasks += cs->nr_migrate_dl_tasks; in cpuset_attach()
3207 oldcs->nr_deadline_tasks -= cs->nr_migrate_dl_tasks; in cpuset_attach()
3224 int retval = -ENODEV; in cpuset_write_resmask()
3234 retval = -ENOMEM; in cpuset_write_resmask()
3238 switch (of_cft(of)->private) { in cpuset_write_resmask()
3249 retval = -EINVAL; in cpuset_write_resmask()
3274 cpuset_filetype_t type = seq_cft(sf)->private; in cpuset_common_seq_show()
3281 seq_printf(sf, "%*pbl\n", cpumask_pr_args(cs->cpus_allowed)); in cpuset_common_seq_show()
3284 seq_printf(sf, "%*pbl\n", nodemask_pr_args(&cs->mems_allowed)); in cpuset_common_seq_show()
3287 seq_printf(sf, "%*pbl\n", cpumask_pr_args(cs->effective_cpus)); in cpuset_common_seq_show()
3290 seq_printf(sf, "%*pbl\n", nodemask_pr_args(&cs->effective_mems)); in cpuset_common_seq_show()
3293 seq_printf(sf, "%*pbl\n", cpumask_pr_args(cs->exclusive_cpus)); in cpuset_common_seq_show()
3296 seq_printf(sf, "%*pbl\n", cpumask_pr_args(cs->effective_xcpus)); in cpuset_common_seq_show()
3305 ret = -EINVAL; in cpuset_common_seq_show()
3317 switch (cs->partition_root_state) { in cpuset_partition_show()
3333 err = perr_strings[READ_ONCE(cs->prs_err)]; in cpuset_partition_show()
3348 int retval = -ENODEV; in cpuset_partition_write()
3359 return -EINVAL; in cpuset_partition_write()
3361 css_get(&cs->css); in cpuset_partition_write()
3368 css_put(&cs->css); in cpuset_partition_write()
3417 .name = "cpus.exclusive",
3426 .name = "cpus.exclusive.effective",
3451 * cpuset_css_alloc - Allocate a cpuset css
3454 * Return: cpuset css on success, -ENOMEM on failure.
3456 * Allocate and initialize a new cpuset css, for non-NULL @parent_css, return
3469 return ERR_PTR(-ENOMEM); in cpuset_css_alloc()
3473 return ERR_PTR(-ENOMEM); in cpuset_css_alloc()
3476 __set_bit(CS_SCHED_LOAD_BALANCE, &cs->flags); in cpuset_css_alloc()
3477 fmeter_init(&cs->fmeter); in cpuset_css_alloc()
3478 cs->relax_domain_level = -1; in cpuset_css_alloc()
3479 INIT_LIST_HEAD(&cs->remote_sibling); in cpuset_css_alloc()
3483 __set_bit(CS_MEMORY_MIGRATE, &cs->flags); in cpuset_css_alloc()
3485 return &cs->css; in cpuset_css_alloc()
3501 set_bit(CS_ONLINE, &cs->flags); in cpuset_css_online()
3503 set_bit(CS_SPREAD_PAGE, &cs->flags); in cpuset_css_online()
3505 set_bit(CS_SPREAD_SLAB, &cs->flags); in cpuset_css_online()
3510 clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags); in cpuset_css_online()
3516 cpumask_copy(cs->effective_cpus, parent->effective_cpus); in cpuset_css_online()
3517 cs->effective_mems = parent->effective_mems; in cpuset_css_online()
3521 if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags)) in cpuset_css_online()
3527 * historical reasons - the flag may be specified during mount. in cpuset_css_online()
3529 * Currently, if any sibling cpusets have exclusive cpus or mem, we in cpuset_css_online()
3530 * refuse to clone the configuration - thereby refusing the task to in cpuset_css_online()
3534 * changed to grant parent->cpus_allowed-sibling_cpus_exclusive in cpuset_css_online()
3547 cs->mems_allowed = parent->mems_allowed; in cpuset_css_online()
3548 cs->effective_mems = parent->mems_allowed; in cpuset_css_online()
3549 cpumask_copy(cs->cpus_allowed, parent->cpus_allowed); in cpuset_css_online()
3550 cpumask_copy(cs->effective_cpus, parent->cpus_allowed); in cpuset_css_online()
3576 clear_bit(CS_ONLINE, &cs->flags); in cpuset_css_offline()
3584 * changing it back to member to free its exclusive CPUs back to the pool to
3635 struct cpuset *cs = css_cs(cset->subsys[cpuset_cgrp_id]); in cpuset_can_fork()
3666 cs->attach_in_progress++; in cpuset_can_fork()
3674 struct cpuset *cs = css_cs(cset->subsys[cpuset_cgrp_id]); in cpuset_cancel_fork()
3706 set_cpus_allowed_ptr(task, current->cpus_ptr); in cpuset_fork()
3707 task->mems_allowed = current->mems_allowed; in cpuset_fork()
3743 * cpuset_init - initialize cpusets at system boot
3786 cpumask_copy(new_cpus, parent_cs(cs)->effective_cpus); in hotplug_update_tasks()
3788 *new_mems = parent_cs(cs)->effective_mems; in hotplug_update_tasks()
3791 cpumask_copy(cs->effective_cpus, new_cpus); in hotplug_update_tasks()
3792 cs->effective_mems = *new_mems; in hotplug_update_tasks()
3807 * cpuset_hotplug_update_tasks - update tasks in a cpuset for hotunplug
3822 int partcmd = -1; in cpuset_hotplug_update_tasks()
3825 wait_event(cpuset_attach_wq, cs->attach_in_progress == 0); in cpuset_hotplug_update_tasks()
3833 if (cs->attach_in_progress) { in cpuset_hotplug_update_tasks()
3840 nodes_and(new_mems, cs->mems_allowed, parent->effective_mems); in cpuset_hotplug_update_tasks()
3842 if (!tmp || !cs->partition_root_state) in cpuset_hotplug_update_tasks()
3855 cs->prs_err = PERR_HOTPLUG; in cpuset_hotplug_update_tasks()
3887 cpus_updated = !cpumask_equal(&new_cpus, cs->effective_cpus); in cpuset_hotplug_update_tasks()
3888 mems_updated = !nodes_equal(new_mems, cs->effective_mems); in cpuset_hotplug_update_tasks()
3907 * cpuset_handle_hotplug - handle CPU/memory hot{,un}plug for a cpuset
3915 * Non-root cpusets are only affected by offlining. If any CPUs or memory
3996 if (cs == &top_cpuset || !css_tryget_online(&cs->css)) in cpuset_handle_hotplug()
4003 css_put(&cs->css); in cpuset_handle_hotplug()
4038 * cpuset_init_smp - initialize cpus_allowed
4061 * cpuset_cpus_allowed - return cpus_allowed mask from a tasks cpuset.
4062 * @tsk: pointer to task_struct from which to obtain cpuset->cpus_allowed.
4066 * attached to the specified @tsk. Guaranteed to return some non-empty
4104 * cpuset_cpus_allowed_fallback - final fallback before complete catastrophe.
4108 * tsk->cpus_allowed, we fall back to task_cs(tsk)->cpus_allowed. In legacy
4109 * mode however, this value is the same as task_cs(tsk)->effective_cpus,
4124 cs_mask = task_cs(tsk)->cpus_allowed; in cpuset_cpus_allowed_fallback()
4132 * We own tsk->cpus_allowed, nobody can change it under us. in cpuset_cpus_allowed_fallback()
4134 * But we used cs && cs->cpus_allowed lockless and thus can in cpuset_cpus_allowed_fallback()
4136 * the wrong tsk->cpus_allowed. However, both cases imply the in cpuset_cpus_allowed_fallback()
4137 * subsequent cpuset_change_cpumask()->set_cpus_allowed_ptr() in cpuset_cpus_allowed_fallback()
4141 * changes in tsk_cs()->cpus_allowed. Otherwise we can temporary in cpuset_cpus_allowed_fallback()
4153 nodes_setall(current->mems_allowed); in cpuset_init_current_mems_allowed()
4157 * cpuset_mems_allowed - return mems_allowed mask from a tasks cpuset.
4158 * @tsk: pointer to task_struct from which to obtain cpuset->mems_allowed.
4161 * attached to the specified @tsk. Guaranteed to return some non-empty
4181 * cpuset_nodemask_valid_mems_allowed - check nodemask vs. current mems_allowed
4184 * Are any of the nodes in the nodemask allowed in current->mems_allowed?
4188 return nodes_intersects(*nodemask, current->mems_allowed); in cpuset_nodemask_valid_mems_allowed()
4192 * nearest_hardwall_ancestor() - Returns the nearest mem_exclusive or
4205 * cpuset_current_node_allowed - Can current task allocate on a memory node?
4238 * in_interrupt - any node ok (current task context irrelevant)
4239 * GFP_ATOMIC - any node ok
4240 * tsk_is_oom_victim - any node ok
4241 * GFP_KERNEL - any node in enclosing hardwalled cpuset ok
4242 * GFP_USER - only nodes in current tasks mems allowed ok.
4252 if (node_isset(node, current->mems_allowed)) in cpuset_current_node_allowed()
4263 if (current->flags & PF_EXITING) /* Let dying task have memory */ in cpuset_current_node_allowed()
4271 allowed = node_isset(node, cs->mems_allowed); in cpuset_current_node_allowed()
4298 * or callback_lock - but node_isset is atomic and the reference in cpuset_node_allowed()
4302 * relax locking here to avoid taking global locks - while accepting in cpuset_node_allowed()
4309 allowed = node_isset(nid, cs->effective_mems); in cpuset_node_allowed()
4315 * cpuset_spread_node() - On which node to begin search for a page
4331 * only set nodes in task->mems_allowed that are online. So it
4342 return *rotor = next_node_in(*rotor, current->mems_allowed); in cpuset_spread_node()
4346 * cpuset_mem_spread_node() - On which node to begin search for a file page
4350 if (current->cpuset_mem_spread_rotor == NUMA_NO_NODE) in cpuset_mem_spread_node()
4351 current->cpuset_mem_spread_rotor = in cpuset_mem_spread_node()
4352 node_random(&current->mems_allowed); in cpuset_mem_spread_node()
4354 return cpuset_spread_node(&current->cpuset_mem_spread_rotor); in cpuset_mem_spread_node()
4358 * cpuset_mems_allowed_intersects - Does @tsk1's mems_allowed intersect @tsk2's?
4371 return nodes_intersects(tsk1->mems_allowed, tsk2->mems_allowed); in cpuset_mems_allowed_intersects()
4375 * cpuset_print_current_mems_allowed - prints current's cpuset and mems_allowed
4386 cgrp = task_cs(current)->css.cgroup; in cpuset_print_current_mems_allowed()
4390 nodemask_pr_args(&current->mems_allowed)); in cpuset_print_current_mems_allowed()
4399 nodemask_pr_args(&task->mems_allowed)); in cpuset_task_status_allowed()
4401 nodemask_pr_args(&task->mems_allowed)); in cpuset_task_status_allowed()