Skip to content

Commit c80d401

Browse files
dtcccchtejun
authored andcommitted
cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
subparts_cpus should be limited as a subset of cpus_allowed, but it is updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to fix it. Fixes: ee8dde0 ("cpuset: Add new v2 cpuset.sched.partition flag") Signed-off-by: Tianchen Ding <[email protected]> Reviewed-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent d068eeb commit c80d401

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/cgroup/cpuset.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
16351635
* Make sure that subparts_cpus is a subset of cpus_allowed.
16361636
*/
16371637
if (cs->nr_subparts_cpus) {
1638-
cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
1639-
cs->cpus_allowed);
1638+
cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
16401639
cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
16411640
}
16421641
spin_unlock_irq(&callback_lock);

0 commit comments

Comments
 (0)