Skip to content

Commit 14713ed

Browse files
Waiman-Longhtejun
authored andcommitted
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 <[email protected]> Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 17b1860 commit 14713ed

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

kernel/cgroup/cpuset.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,11 +1180,15 @@ static void isolated_cpus_update(int old_prs, int new_prs, struct cpumask *xcpus
11801180
WARN_ON_ONCE(old_prs == new_prs);
11811181
lockdep_assert_held(&callback_lock);
11821182
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;
11841186
cpumask_or(isolated_cpus, isolated_cpus, xcpus);
1185-
else
1187+
} else {
1188+
if (!cpumask_intersects(xcpus, isolated_cpus))
1189+
return;
11861190
cpumask_andnot(isolated_cpus, isolated_cpus, xcpus);
1187-
1191+
}
11881192
isolated_cpus_updating = true;
11891193
}
11901194

0 commit comments

Comments
 (0)