summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRidong Chen <chenridong@xiaomi.com>2026-11-14 18:06:12 +0800
committerTejun Heo <tj@kernel.org>2026-11-15 10:15:02 -1000
commit42ef815ff6b282e75248e8e084508fca4a694b70 (patch)
tree13d10705080df3573b69dd16c57e36f7cace234e
parent7693e1350b06191143724da742559fb47211348e (diff)
cgroup/cpuset: Remove redundant WARN_ON_ONCE() in remote_cpus_update()
remote_cpus_update() warns if the CPUs to be added to a remote partition intersect subpartitions_cpus, and then checks the very same condition right below to set PERR_NOCPUS and invalidate the partition: WARN_ON_ONCE(cpumask_intersects(tmp->addmask, subpartitions_cpus)); if (!capable(CAP_SYS_ADMIN)) WRITE_ONCE(cs->prs_err, PERR_ACCESS); else if (cpumask_intersects(tmp->addmask, subpartitions_cpus) || cpumask_subset(top_cpuset.effective_cpus, tmp->addmask)) WRITE_ONCE(cs->prs_err, PERR_NOCPUS); Sashiko reported that the warning could be triggered by a write to a cpuset control file, before the CAP_SYS_ADMIN check, which would panic a system with panic_on_warn set. The warning was added by commit 86888c7bd117 ("cgroup/cpuset: Add warnings to catch inconsistency in exclusive CPUs") as an assertion that such CPUs have been filtered out before. No way to trigger it with the current interfaces has been found, as these CPUs are rejected when cpuset.cpus.exclusive is written. But the warning is redundant, as the conflict is handled right below anyway. Remove the warning and rely on the PERR_NOCPUS check, the same as remote_partition_enable() already does for this conflict. Reported-by: Sashiko <sashiko-bot@kernel.org> Link: https://sashiko.dev/#/patchset/20261114083124.1340140-1-ridong.chen%40linux.dev?part=6 Signed-off-by: Ridong Chen <chenridong@xiaomi.com> Reviewed-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--kernel/cgroup/cpuset.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 7e374210c123..0be0d26c442b 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1833,7 +1833,6 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *xcpus,
* left in the top cpuset.
*/
if (adding) {
- WARN_ON_ONCE(cpumask_intersects(tmp->addmask, subpartitions_cpus));
if (!capable(CAP_SYS_ADMIN))
WRITE_ONCE(cs->prs_err, PERR_ACCESS);
else if (cpumask_intersects(tmp->addmask, subpartitions_cpus) ||