Skip to content

Commit df59b72

Browse files
Waiman-Longhtejun
authored andcommitted
cgroup/cpuset: Skip task update if hotplug doesn't affect current cpuset
If a hotplug event doesn't affect the current cpuset, there is no point to call hotplug_update_tasks() or hotplug_update_tasks_legacy(). So just skip it. Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 5dcad50 commit df59b72

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

kernel/cgroup/cpuset.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3516,6 +3516,8 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp)
35163516
update_tasks:
35173517
cpus_updated = !cpumask_equal(&new_cpus, cs->effective_cpus);
35183518
mems_updated = !nodes_equal(new_mems, cs->effective_mems);
3519+
if (!cpus_updated && !mems_updated)
3520+
goto unlock; /* Hotplug doesn't affect this cpuset */
35193521

35203522
if (mems_updated)
35213523
check_insane_mems_config(&new_mems);
@@ -3527,6 +3529,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp)
35273529
hotplug_update_tasks_legacy(cs, &new_cpus, &new_mems,
35283530
cpus_updated, mems_updated);
35293531

3532+
unlock:
35303533
percpu_up_write(&cpuset_rwsem);
35313534
}
35323535

0 commit comments

Comments
 (0)