From: Waiman Long Date: Fri, 17 Mar 2023 15:15:06 +0000 (-0400) Subject: cgroup/cpuset: Skip task update if hotplug doesn't affect current cpuset X-Git-Tag: v6.6.7~2953^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df59b72cd8fb8ca00301f47e65853efed195d23f;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo --- diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 8472c71..a05bc93 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -3516,6 +3516,8 @@ retry: update_tasks: cpus_updated = !cpumask_equal(&new_cpus, cs->effective_cpus); mems_updated = !nodes_equal(new_mems, cs->effective_mems); + if (!cpus_updated && !mems_updated) + goto unlock; /* Hotplug doesn't affect this cpuset */ if (mems_updated) check_insane_mems_config(&new_mems); @@ -3527,6 +3529,7 @@ update_tasks: hotplug_update_tasks_legacy(cs, &new_cpus, &new_mems, cpus_updated, mems_updated); +unlock: percpu_up_write(&cpuset_rwsem); }