Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db6c57d2 authored by Tianchen Ding's avatar Tianchen Ding Committed by Greg Kroah-Hartman
Browse files

cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()



commit c80d401c52a2d1baf2a5afeb06f0ffe678e56d23 upstream.

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: ee8dde0c ("cpuset: Add new v2 cpuset.sched.partition flag")
Signed-off-by: default avatarTianchen Ding <dtcccc@linux.alibaba.com>
Reviewed-by: default avatarWaiman Long <longman@redhat.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd43771e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1558,8 +1558,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);