All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] cgroup/cpuset: Fix partition switch after a sibling releases CPUs
@ 2026-12-03 19:58 Hang Zhengyang
  2026-12-03 19:58 ` [PATCH 1/2] cgroup/cpuset: Update the parent when a partition switch adds CPUs Hang Zhengyang
  2026-12-03 19:58 ` [PATCH 2/2] selftests/cgroup: Test partition switches after a sibling releases CPUs Hang Zhengyang
  0 siblings, 2 replies; 4+ messages in thread
From: Hang Zhengyang @ 2026-12-03 19:58 UTC (permalink / raw)
  To: Waiman Long, Ridong Chen, Tejun Heo
  Cc: Johannes Weiner, Michal Koutný, Shuah Khan, cgroups,
	linux-kselftest, linux-kernel

Since commit 2a3602030d80 ("cgroup/cpuset: Don't invalidate sibling
partitions on cpuset.cpus conflict"), a partition without
cpuset.cpus.exclusive whose cpuset.cpus overlap the exclusive CPUs of a
sibling gets only the other CPUs. When the sibling releases them, the
partition keeps its CPUs until they are recomputed. A switch between
root and isolated recomputes them and takes the released CPUs without
taking them from the parent, so the CPUs end up in two partitions.
Patch 1 fixes the switch for local and remote partitions. Patch 2 adds
tests.

CPU hotplug recomputes them the same way, so offlining a CPU after the
sibling released its CPUs also leads to overlapping partitions. Chen
Ridong's v6 "cpuset: rework local partition logic" and Waiman Long's v4
"More fix patches" both change that path, so I left it alone. The switch
problem reproduces with either series applied. Another way to fix both
would be to update valid sibling partitions when a cpuset releases
exclusive CPUs. I can do that instead, or rebase on the rework, if you
prefer.

The series is based on cgroup/for-7.4-fixes and also applies to
cgroup/for-next.

Testing:
- Reproduced on v7.0, v7.4-rc5 and next-20261202, not on v6.18 or on
  the parent of 2a3602030d80.
- With the series, test_cpuset_prs.sh passes on cgroup/for-7.4-fixes
  and next-20261202 with 8 CPUs, and on next-20261202 with 12 CPUs and
  isolcpus=10-11. Without patch 1, the new cases fail.

I used Claude Code to find the issue, write the patches and run the
tests. I reviewed the patches.

Hang Zhengyang (2):
  cgroup/cpuset: Update the parent when a partition switch adds CPUs
  selftests/cgroup: Test partition switches after a sibling releases
    CPUs

 kernel/cgroup/cpuset.c                        | 41 ++++++++++++++-----
 .../selftests/cgroup/test_cpuset_prs.sh       | 14 +++++++
 2 files changed, 45 insertions(+), 10 deletions(-)


base-commit: 05afa0c55015b3c7f3c2136dde7fbcfe5195b21f
-- 
2.53.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-04  3:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 19:58 [PATCH 0/2] cgroup/cpuset: Fix partition switch after a sibling releases CPUs Hang Zhengyang
2026-12-03 19:58 ` [PATCH 1/2] cgroup/cpuset: Update the parent when a partition switch adds CPUs Hang Zhengyang
2026-12-04  3:35   ` Ridong Chen
2026-12-03 19:58 ` [PATCH 2/2] selftests/cgroup: Test partition switches after a sibling releases CPUs Hang Zhengyang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.