mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hang Zhengyang <hang.zhengyang1010@gmail.com>
To: Waiman Long <longman@redhat.com>,
	Ridong Chen <ridong.chen@linux.dev>, Tejun Heo <tj@kernel.org>
Cc: "Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Shuah Khan" <shuah@kernel.org>,
	cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] cgroup/cpuset: Fix partition switch after a sibling releases CPUs
Date: Thu,  3 Dec 2026 19:58:41 +0000	[thread overview]
Message-ID: <20261203195843.187930-1-hang.zhengyang1010@gmail.com> (raw)

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


             reply	other threads:[~2026-12-03 19:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 19:58 Hang Zhengyang [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203195843.187930-1-hang.zhengyang1010@gmail.com \
    --to=hang.zhengyang1010@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=ridong.chen@linux.dev \
    --cc=shuah@kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®