[PATCH cgroup/for-next 0/4] cgroup/cpuset: Support multiple source/destination cpusets for cpuset_*attach()

From: Waiman Long

Date: Thu May 14 2026 - 13:03:27 EST


Sashiko AI review of another cpuset patch had found that cpuset_attach()
and cpuset_can_attach() can be passed a cgroup_taskset with tasks
migrating from one source cpuset to multiple destination cpusets and
vice versa. Further testing of the cpuset code indicates that this is
indeed the case when the v2 cpuset controller is enabled or disabled.

Unfortunately, cpuset_attach() and cpuset_can_attach() still assume that
there will be one source and one destinaton cpuset which may result in
inocrrect behavior. This patch series is created to fix this issue. The
first 3 patches are just preparatory patches to make it easier to review
the last patch which fixes this problem.

Waiman Long (4):
cgroup/cpuset: Add an alloc_dl_bw() helper
cgroup/cpuset: Expand the scope of cpuset_can_attach_check()
cgroup/cpuset: Optimize cpuset_attach_task()
cgroup/cpuset: Support multiple source/destination cpusets for
cpuset_*attach()

kernel/cgroup/cpuset-internal.h | 6 +
kernel/cgroup/cpuset.c | 315 +++++++++++++++++++++++---------
2 files changed, 230 insertions(+), 91 deletions(-)

--
2.54.0