Re: [PATCH-next v4 5/6] cgroup/cpuset: Handle remote partitions before local partitions in cpuset_handle_hotplug()
From: Ridong Chen
Date: Mon Nov 16 2026 - 02:08:23 EST
On 11/16/2026 9:23 AM, Waiman Long wrote:
When there is a valid remote partition underneath an invalid local
partition with subpartitions_cpus cleared because of missing active
CPUs in the top_cpuset partition, the current iteration logic in
cpuset_handle_hotplug() will handle the invalid local partition first
and potentially make the local partition valid. The remote partition
will be handled later with the potential that both the local and remote
partitions will be valid with overlapping exclusive CPUs violating the
cpu exclusivity rule.
Hi Longman,
Patch 5 and Guopeng's patch [1] handle the same case: after hotplug,
top_cpuset has no usable CPU left (no active CPU, or no active boot
domain housekeeping CPU). But they take different approaches:
- Current code: clear subpartitions_cpus and invalidate all the
partitions.
- [1]: only invalidate the partitions that can give an active
housekeeping CPU back to top_cpuset.
- Patch 5: invalidate all the local partitions but keep the remote
ones valid if possible.
I think we should agree on the expected behavior first. My preference
is to keep it simple and invalidate all the partitions as the current
code does. The problem is that in the same hotplug pass, after valid
partition A is invalidated and its CPUs are given back to top_cpuset,
partition B, which was invalid before, may become valid again. B puts
its CPUs back into subpartitions_cpus, so a valid partition visited
after B is not invalidated (patch 1), or B overlaps with a remote
partition underneath it (patch 5). If invalid partitions are not
allowed to become valid again in that pass, both issues go away.
Do we really need to keep some partitions valid in this case?
[1] https://lore.kernel.org/cgroups/20261111134250.16852-2-guopeng.zhang@xxxxxxxxx/
--
Best regards
Ridong