summaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index f6b33c696224..f9d4807c869f 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1383,12 +1383,9 @@ static int cpuset_can_attach(struct cgroup_subsys_state *css,
mutex_lock(&cpuset_mutex);
- /*
- * We allow to move tasks into an empty cpuset if sane_behavior
- * flag is set.
- */
+ /* allow moving tasks into an empty cpuset if on default hierarchy */
ret = -ENOSPC;
- if (!cgroup_sane_behavior(css->cgroup) &&
+ if (!cgroup_on_dfl(css->cgroup) &&
(cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed)))
goto out_unlock;
@@ -2030,7 +2027,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs)
static cpumask_t off_cpus;
static nodemask_t off_mems;
bool is_empty;
- bool sane = cgroup_sane_behavior(cs->css.cgroup);
+ bool on_dfl = cgroup_on_dfl(cs->css.cgroup);
retry:
wait_event(cpuset_attach_wq, cs->attach_in_progress == 0);
@@ -2054,12 +2051,12 @@ retry:
mutex_unlock(&callback_mutex);
/*
- * If sane_behavior flag is set, we need to update tasks' cpumask
- * for empty cpuset to take on ancestor's cpumask. Otherwise, don't
- * call update_tasks_cpumask() if the cpuset becomes empty, as
- * the tasks in it will be migrated to an ancestor.
+ * If on_dfl, we need to update tasks' cpumask for empty cpuset to
+ * take on ancestor's cpumask. Otherwise, don't call
+ * update_tasks_cpumask() if the cpuset becomes empty, as the tasks
+ * in it will be migrated to an ancestor.
*/
- if ((sane && cpumask_empty(cs->cpus_allowed)) ||
+ if ((on_dfl && cpumask_empty(cs->cpus_allowed)) ||
(!cpumask_empty(&off_cpus) && !cpumask_empty(cs->cpus_allowed)))
update_tasks_cpumask(cs);
@@ -2068,12 +2065,12 @@ retry:
mutex_unlock(&callback_mutex);
/*
- * If sane_behavior flag is set, we need to update tasks' nodemask
- * for empty cpuset to take on ancestor's nodemask. Otherwise, don't
- * call update_tasks_nodemask() if the cpuset becomes empty, as
- * the tasks in it will be migratd to an ancestor.
+ * If on_dfl, we need to update tasks' nodemask for empty cpuset to
+ * take on ancestor's nodemask. Otherwise, don't call
+ * update_tasks_nodemask() if the cpuset becomes empty, as the
+ * tasks in it will be migratd to an ancestor.
*/
- if ((sane && nodes_empty(cs->mems_allowed)) ||
+ if ((on_dfl && nodes_empty(cs->mems_allowed)) ||
(!nodes_empty(off_mems) && !nodes_empty(cs->mems_allowed)))
update_tasks_nodemask(cs);
@@ -2083,13 +2080,13 @@ retry:
mutex_unlock(&cpuset_mutex);
/*
- * If sane_behavior flag is set, we'll keep tasks in empty cpusets.
+ * If on_dfl, we'll keep tasks in empty cpusets.
*
* Otherwise move tasks to the nearest ancestor with execution
* resources. This is full cgroup operation which will
* also call back into cpuset. Should be done outside any lock.
*/
- if (!sane && is_empty)
+ if (!on_dfl && is_empty)
remove_tasks_in_empty_cpuset(cs);
}