Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Chen Ridong <chenridong@huaweicloud.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Waiman Long and committed by
Tejun Heo
14713ed9 17b18600

+7 -3
+7 -3
kernel/cgroup/cpuset.c
··· 1180 1180 WARN_ON_ONCE(old_prs == new_prs); 1181 1181 lockdep_assert_held(&callback_lock); 1182 1182 lockdep_assert_held(&cpuset_mutex); 1183 - if (new_prs == PRS_ISOLATED) 1183 + if (new_prs == PRS_ISOLATED) { 1184 + if (cpumask_subset(xcpus, isolated_cpus)) 1185 + return; 1184 1186 cpumask_or(isolated_cpus, isolated_cpus, xcpus); 1185 - else 1187 + } else { 1188 + if (!cpumask_intersects(xcpus, isolated_cpus)) 1189 + return; 1186 1190 cpumask_andnot(isolated_cpus, isolated_cpus, xcpus); 1187 - 1191 + } 1188 1192 isolated_cpus_updating = true; 1189 1193 } 1190 1194