diff options
| author | Shaojie Sun <sunshaojie@kylinos.cn> | 2026-10-30 21:14:08 +0800 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-10-30 15:13:28 -1000 |
| commit | 63572eb9ab96bed176b33cca4f62c7c95946c812 (patch) | |
| tree | e2595deac74088898ecc83d3a27d1220b6604f38 /scripts/Makefile.thinlto | |
| parent | 7f64fdeaf3b738f4c75a6d820032270c6732962e (diff) | |
| download | linux-next-63572eb9ab96bed176b33cca4f62c7c95946c812.tar.gz linux-next-63572eb9ab96bed176b33cca4f62c7c95946c812.zip | |
cgroup/cpuset: Drop redundant no-cpu check in partcmd_update with newmask
update_parent_effective_cpumask() with a non-NULL newmask is only ever
reached from partition_cpus_change(), and only after validate_partition()
has checked the very same condition with the very same arguments:
tasks_nocpu_error(parent_cs(cs), cs, trialcs->effective_xcpus)
since newmask is exactly trialcs->effective_xcpus and both functions use
parent_cs(cs) as the parent. cs, parent and cpu_active_mask cannot change
in between either, as cpuset_mutex and cpu_read_lock are held for the
whole operation. Hence
nocpu = tasks_nocpu_error(parent, cs, newmask);
is always false here and the block that turns a "nocpu" condition into
PERR_NOCPUS is dead code. A new CPU list that would drain the parent is
fully handled by validate_partition(), which routes the write to
partcmd_invalidate and hands the partition's CPUs back to the parent.
The "!adding || !cpumask_intersects(addmask, cpu_active_mask)" test that
guards the block does not change this: the block can only be entered when
nocpu is true, and that never happens here.
Drop the redundant check and the dead PERR_NOCPUS block, and leave a
comment pointing at where the "parent could be drained" case is handled.
The empty-newmask check in the same branch is left alone: it validates
the newmask argument of this function, while what is removed here is a
decision that belongs to validate_partition().
No functional change.
Signed-off-by: Shaojie Sun <sunshaojie@kylinos.cn>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
