Skip to content

cgroup/cpuset: Don't invalidate sibling partitions on cpuset.cpus conflict

Waiman Long cgroups linux-doc linux-kselftest lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 1 replyIn review
  2. v45 patches 5 repliesSuperseded
  3. v35 patches 10 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches22 repliesSuperseded
v14 patches9 repliesSuperseded

Changes in v5 from the cover letter

- Fix patch 4 doc change as reported by Michael.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5cgroup/cpuset: Streamline rm_siblings_excl_cpus()kernel/cgroup/cpuset.c+15 -90 replies
2/5cgroup/cpuset: Consistently compute effective_xcpus in update_cpumasks_hier()kernel/cgroup/cpuset.c+5 -90 replies
3/5cgroup/cpuset: Don't fail cpuset.cpus change in v2Documentation/admin-guide/cgroup-v2.rst kernel/cgroup/cpuset.c+19 -190 replies
4/5cgroup/cpuset: Don't invalidate sibling partitions on cpuset.cpus conflictDocumentation/admin-guide/cgroup-v2.rst kernel/cgroup/cpuset-internal.h kernel/cgroup/cpuset-v1.c +2 more+90 -710 replies
5/5cgroup/cpuset: Move the v1 empty cpus/mems check to cpuset1_validate_change()kernel/cgroup/cpuset-internal.h kernel/cgroup/cpuset-v1.c kernel/cgroup/cpuset.c +1 more+26 -230 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchChen Ridong
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH cgroup/for-6.20 v5 0/5] cgroup/cpuset: Don't invalidate sibling partitions on cpuset.cpus conflict

v5:
- Fix patch 4 doc change as reported by Michael.

v4:
- Add tags and fix patch 4 commit log

v3:
- Patch 2: Change the condition for calling reset_partition_data() to

    (new_prs <= 0).

- Patch 4: Update commit log and code comment to clarify the change.
- Add a new patch 5 to move the empty cpus/mems check to cpuset1_validate_change().

v2:
- Patch 1: additional comment
- Patch 2: simplify the conditions for triggering call to compute_excpus().
- Patch 3: update description of cpuset.cpus.exclusive in cgroup-v2.rst to reflect the new behavior and change the name of the new cpus_excl_conflict() parameter to xcpus_changed.
- Patch 4: update description of cpuset.cpus.partition in cgroup-v2.rst to clarify what exclusive CPUs will be used when a partition is created.

This patch series is inspired by the cpuset patch sent by Sun Shaojie [1]. The idea is to avoid invalidating sibling partitions when there is a cpuset.cpus conflict. However this patch series does it in a slightly different way to make its behavior more consistent with other cpuset properties.

The first 3 patches are just some cleanup and minor bug fixes on issues found during the investigation process. The last one is the major patch that changes the way cpuset.cpus is being handled during the partition creation process. Instead of invalidating sibling partitions when there is a conflict, it will strip out the conflicting exclusive CPUs and assign the remaining non-conflicting exclusive CPUs to the new partition unless there is no more CPU left which will fail the partition creation process. It is similar to the idea that cpuset.cpus.effective may only contain a subset of CPUs specified in cpuset.cpus. So cpuset.cpus.exclusive.effective may contain only a subset of cpuset.cpus when a partition is created without setting cpuset.cpus.exclusive.

Even setting cpuset.cpus.exclusive instead of cpuset.cpus may not guarantee all the requested CPUs can be granted if parent doesn't have access to some of those exclusive CPUs. The difference is that conflicts from siblings is not possible with cpuset.cpus.exclusive as long as it can be set successfully without failure.

[1] https://lore.kernel.org/lkml/[email protected]/

Waiman Long (5):
cgroup/cpuset: Streamline rm_siblings_excl_cpus() cgroup/cpuset: Consistently compute effective_xcpus in
update_cpumasks_hier()
cgroup/cpuset: Don't fail cpuset.cpus change in v2 cgroup/cpuset: Don't invalidate sibling partitions on cpuset.cpus
conflict
cgroup/cpuset: Move the v1 empty cpus/mems check to
cpuset1_validate_change()

 Documentation/admin-guide/cgroup-v2.rst       |  41 +++--
 kernel/cgroup/cpuset-internal.h               |  12 ++
 kernel/cgroup/cpuset-v1.c                     |  33 ++++
 kernel/cgroup/cpuset.c                        | 163 ++++++------------
 .../selftests/cgroup/test_cpuset_prs.sh       |  29 +++-
 5 files changed, 151 insertions(+), 127 deletions(-)
Signature · 1 line
2.52.0