mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH cgroup/for-7.4-fixes 0/2] cgroup/cpuset: Don't migrate the parent's memory on CLONE_INTO_CGROUP
@ 2026-12-04 13:51 Hang Zhengyang
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Hang Zhengyang @ 2026-12-04 13:51 UTC (permalink / raw)
  To: Waiman Long, Ridong Chen, Tejun Heo
  Cc: Johannes Weiner, Michal Koutný,
	Shuah Khan, Christian Brauner, Matthew Ruffell, Caron Wills,
	cgroups, linux-kselftest, linux-kernel

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


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-04 13:51 [PATCH cgroup/for-7.4-fixes 0/2] cgroup/cpuset: Don't migrate the parent's memory on CLONE_INTO_CGROUP Hang Zhengyang
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

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®