]> www.infradead.org Git - users/hch/misc.git/commitdiff
cpuset: Use new excpus for nocpu error check when enabling root partition
authorChen Ridong <chenridong@huawei.com>
Fri, 19 Sep 2025 01:12:27 +0000 (01:12 +0000)
committerTejun Heo <tj@kernel.org>
Fri, 19 Sep 2025 16:41:26 +0000 (06:41 -1000)
A previous patch fixed a bug where new_prs should be assigned before
checking housekeeping conflicts. This patch addresses another potential
issue: the nocpu error check currently uses the xcpus which is not updated.
Although no issue has been observed so far, the check should be performed
using the new effective exclusive cpus.

The comment has been removed because the function returns an error if
nocpu checking fails, which is unrelated to the parent.

Signed-off-by: Chen Ridong <chenridong@huawei.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset.c

index 2b7e2f17577eada0882bed636597206de84a15b2..44d65890326a66603dd1b664ea7691c410c1eb29 100644 (file)
@@ -1818,11 +1818,7 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
                if (prstate_housekeeping_conflict(new_prs, xcpus))
                        return PERR_HKEEPING;
 
-               /*
-                * A parent can be left with no CPU as long as there is no
-                * task directly associated with the parent partition.
-                */
-               if (nocpu)
+               if (tasks_nocpu_error(parent, cs, xcpus))
                        return PERR_NOCPUS;
 
                /*