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>,
	"Christian Brauner" <brauner@kernel.org>,
	"Matthew Ruffell" <matthew.ruffell@canonical.com>,
	"Caron Wills" <caron.wills@pulsar.com>,
	cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH cgroup/for-7.4-fixes 0/2] cgroup/cpuset: Don't migrate the parent's memory on CLONE_INTO_CGROUP
Date: Fri,  4 Dec 2026 13:51:24 +0000	[thread overview]
Message-ID: <20261204135126.598380-1-hang.zhengyang1010@gmail.com> (raw)

Since v7.3, a child created with CLONE_INTO_CGROUP in a cpuset with
other mems has its mm migrated at fork. This moves the parent's memory:
the pages the two share, and with CLONE_VM, as posix_spawn() uses, also
the policies of the parent's mappings. Patch 1 stops the migration at
fork and leaves a shared mm alone. Patch 2 adds tests.

Caron Wills's "cgroup/cpuset: Don't make a forking task wait for memory
migration" [1], posted by Matthew Ruffell, removes the wait for this
migration, and Tejun asked for it to be split. With patch 1 there is
nothing to wait for at fork, so only its change for cpuset_attach() is
still needed. That part applies on top of patch 1; the cpuset_fork()
part conflicts.

Tested on cgroup/for-7.4-fixes in a KVM guest with two NUMA nodes: the
new tests fail without patch 1, also with only [1] applied, and pass
with patch 1. test_core, test_cpuset_prs.sh and the other test_cpuset
tests pass.

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

[1] https://lore.kernel.org/all/20261103075940.110308-7-matthew.ruffell@canonical.com/

Hang Zhengyang (2):
  cgroup/cpuset: Don't migrate the parent's memory on CLONE_INTO_CGROUP
  selftests/cgroup: Test CLONE_INTO_CGROUP into a cpuset with other mems

 kernel/cgroup/cpuset.c                       |  23 ++-
 tools/testing/selftests/cgroup/test_cpuset.c | 201 +++++++++++++++++++
 2 files changed, 220 insertions(+), 4 deletions(-)


base-commit: f7d2a428108d90a4e3fdd2c4d7e4660e780855ff
-- 
2.53.0


             reply	other threads:[~2026-12-04 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 13:51 Hang Zhengyang [this message]
2026-12-04 13:51 ` [PATCH cgroup/for-7.4-fixes 1/2] " Hang Zhengyang
2026-12-04 13:51 ` [PATCH cgroup/for-7.4-fixes 2/2] selftests/cgroup: Test CLONE_INTO_CGROUP into a cpuset with other mems 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=20261204135126.598380-1-hang.zhengyang1010@gmail.com \
    --to=hang.zhengyang1010@gmail.com \
    --cc=brauner@kernel.org \
    --cc=caron.wills@pulsar.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=matthew.ruffell@canonical.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®