cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
Subsystems (2)
PATCH 1/1 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.
--- kernel/cgroup/cpuset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/cgroup/cpuset.c +1 -2
@@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,* Make sure that subparts_cpus is a subset of cpus_allowed. */ if (cs->nr_subparts_cpus) { -cpumask_andnot (cs->subparts_cpus, cs->subparts_cpus, - cs->cpus_allowed); +cpumask_and (cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed); cs->nr_subparts_cpus =cpumask_weight (cs->subparts_cpus); }spin_unlock_irq (&callback_lock);
Signature · 1 line
2.33.0
Quoted 15 lines · Tianchen Ding
subparts_cpusshould be limited as a subset ofcpus_allowed, but it is updated wrongly by usingcpumask_andnot(). Usecpumask_and()instead to fix it.Fixes ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")--- kernel/cgroup/cpuset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)kernel/cgroup/cpuset.c +0
-0
kernel/cgroup/cpuset.c static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, · line 1641
Quoted 9 lines
kernel/cgroup/cpuset.c +1
-2@@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,* Make sure that subparts_cpus is a subset of cpus_allowed. */ if (cs->nr_subparts_cpus) { -cpumask_andnot (cs->subparts_cpus, cs->subparts_cpus, - cs->cpus_allowed); +cpumask_and (cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed); cs->nr_subparts_cpus =cpumask_weight (cs->subparts_cpus); }spin_unlock_irq (&callback_lock);
Thanks for the fix.
Ping~
Any maintainer take a look?
Quoted 24 lines · Tianchen Ding
subparts_cpusshould be limited as a subset ofcpus_allowed, but it is updated wrongly by usingcpumask_andnot(). Usecpumask_and()instead to fix it.Fixes ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")--- kernel/cgroup/cpuset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)kernel/cgroup/cpuset.c +1
-2@@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,* Make sure that subparts_cpus is a subset of cpus_allowed. */ if (cs->nr_subparts_cpus) { -cpumask_andnot (cs->subparts_cpus, cs->subparts_cpus, - cs->cpus_allowed); +cpumask_and (cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed); cs->nr_subparts_cpus =cpumask_weight (cs->subparts_cpus); }spin_unlock_irq (&callback_lock);
Quoted 6 lines · Tianchen Ding
subparts_cpusshould be limited as a subset ofcpus_allowed, but it is updated wrongly by usingcpumask_andnot(). Usecpumask_and()instead to fix it.Fixes ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
Applied to cgroup/for-5.17-fixes.
Thanks.
Signature · 1 line
tejun