Skip to content

Commit dbd6112

Browse files
Waiman-LongSasha Levin
authored andcommitted
cgroup/cpuset: Fix incorrect use of cpuset_update_tasks_cpumask() in update_cpumasks_hier()
[ Upstream commit 68230aa ] Commit e2ffe50 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2") incorrectly changed the 2nd parameter of cpuset_update_tasks_cpumask() from tmp->new_cpus to cp->effective_cpus. This second parameter is just a temporary cpumask for internal use. The cpuset_update_tasks_cpumask() function was originally called update_tasks_cpumask() before commit 381b53c ("cgroup/cpuset: rename functions shared between v1 and v2"). This mistake can incorrectly change the effective_cpus of the cpuset when it is the top_cpuset or in arm64 architecture where task_cpu_possible_mask() may differ from cpu_possible_mask. So far top_cpuset hasn't been passed to update_cpumasks_hier() yet, but arm64 arch can still be impacted. Fix it by reverting the incorrect change. Fixes: e2ffe50 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2") Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a977cd5 commit dbd6112

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/cgroup/cpuset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2350,7 +2350,7 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp,
23502350
WARN_ON(!is_in_v2_mode() &&
23512351
!cpumask_equal(cp->cpus_allowed, cp->effective_cpus));
23522352

2353-
cpuset_update_tasks_cpumask(cp, cp->effective_cpus);
2353+
cpuset_update_tasks_cpumask(cp, tmp->new_cpus);
23542354

23552355
/*
23562356
* On default hierarchy, inherit the CS_SCHED_LOAD_BALANCE

0 commit comments

Comments
 (0)