Commit 14713ed9 authored by Waiman Long's avatar Waiman Long Committed by Tejun Heo
Browse files

cgroup/cpuset: Set isolated_cpus_updating only if isolated_cpus is changed



As cpuset is updating HK_TYPE_DOMAIN housekeeping mask when there is
a change in the set of isolated CPUs, making this change is now more
costly than before.  Right now, the isolated_cpus_updating flag can be
set even if there is no real change in isolated_cpus. Put in additional
checks to make sure that isolated_cpus_updating is set only if there
is a real change in isolated_cpus.

Reviewed-by: default avatarChen Ridong <chenridong@huaweicloud.com>
Signed-off-by: default avatarWaiman Long <longman@redhat.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 17b18600
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1180,11 +1180,15 @@ static void isolated_cpus_update(int old_prs, int new_prs, struct cpumask *xcpus
	WARN_ON_ONCE(old_prs == new_prs);
	lockdep_assert_held(&callback_lock);
	lockdep_assert_held(&cpuset_mutex);
	if (new_prs == PRS_ISOLATED)
	if (new_prs == PRS_ISOLATED) {
		if (cpumask_subset(xcpus, isolated_cpus))
			return;
		cpumask_or(isolated_cpus, isolated_cpus, xcpus);
	else
	} else {
		if (!cpumask_intersects(xcpus, isolated_cpus))
			return;
		cpumask_andnot(isolated_cpus, isolated_cpus, xcpus);

	}
	isolated_cpus_updating = true;
}