diff options
| author | Waiman Long <longman@redhat.com> | 2026-10-25 17:44:44 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-10-26 07:44:25 -1000 |
| commit | 10a6f00d82544a1baa901de8d28f41f28c364995 (patch) | |
| tree | 01154c50da7b038f12b10438ba23f4e89a0e2430 /scripts/basic/split-include.c | |
| parent | 40a0d5c05a2be7b1c23c32f1327289d26d479ae6 (diff) | |
| download | linux-10a6f00d82544a1baa901de8d28f41f28c364995.tar.gz linux-10a6f00d82544a1baa901de8d28f41f28c364995.zip | |
cgroup/cpuset: Prevent recursive call of remote_cpus_update() via update_cpumasks_hier()
Guopeng reports that changing the cpumask of a remote partition root
may set the effective_cpus of the top_cpuset incorrectly. It is
due to the following call sequence:
update_cpumask()
-> partition_cpus_change()
-> remote_cpus_update()
-> update_sibling_cpumasks()
-> update_cpumasks_hier()
-> remote_cpus_update()
The second remote_cpus_update() call passes in the cs->effective_xcpus
instead of the trialcs->effective_xcpus of the first remote_cpus_update()
call. As a result, the second call can revert what has been done in
the first call leading to incorrect effective_cpus of the top_cpuset
as well as subpartitions_cpus.
Fix that by adding a new remote_partition_updating flag into the cpuset
structure to indicate that a remote partition is being updated and
update_cpumasks_hier() should skip the whole subtree as update_cpumask()
or update_exclusive_cpumask() which calls partition_cpus_change()
will eventually calls update_cpumasks_hier() for that subtree anyway.
This new flag is currently set only in remote_cpus_update() to prevent
recursive call of remote_cpus_update() on the same cpuset.
A test case is added to test_cpuset_prs.sh to verify this change.
Reported-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Link: https://lore.kernel.org/lkml/20261010075947.333549-2-guopeng.zhang@linux.dev
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Fixes: f62a5d39368e ("cgroup/cpuset: Remove remote_partition_check() & make update_cpumasks_hier() handle remote partition")
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
