]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cpuset: introduce partition_cpus_change
authorChen Ridong <chenridong@huawei.com>
Wed, 17 Sep 2025 06:04:52 +0000 (06:04 +0000)
committerTejun Heo <tj@kernel.org>
Wed, 17 Sep 2025 18:37:31 +0000 (08:37 -1000)
commit27db8246004ad467ab36dedce847e24f9ca34b94
tree14f5b1f506157a50eb42900d334dc39d244b7808
parentc6366739804f836ac88474527430d3fd174580eb
cpuset: introduce partition_cpus_change

Introduce the partition_cpus_change function to handle both regular CPU
set updates and exclusive CPU modifications, either of which may trigger
partition state changes. This generalized function will also be utilized
for exclusive CPU updates in subsequent patches.

With the introduction of compute_trialcs_excpus in a previous patch,
the trialcs->effective_xcpus field is now consistently computed and
maintained. Consequently, the legacy logic which assigned
**trialcs->allowed_cpus to a local 'xcpus' variable** when
trialcs->effective_xcpus was empty has been removed.

This removal is safe because when trialcs is not a partition member,
trialcs->effective_xcpus is now correctly populated with the intersection
of user_xcpus and the parent's effective_xcpus. This calculation inherently
covers the scenario previously handled by the removed code.

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