[PATCH v3 0/2] cgroup/cpuset: fix DL attach accounting
From: Guopeng Zhang
Date: Sat May 09 2026 - 06:21:18 EST
Hi,
This v3 series contains two cpuset fixes for SCHED_DEADLINE attach
accounting.
Patch 1 fixes an internal cpuset_can_attach() failure path where
temporary DL migration state can be left behind if a later per-task
check fails before cpuset marks attach_in_progress.
Patch 2 keeps cpuset DL bandwidth reservation aligned with the condition
used by set_cpus_allowed_dl() for source-side bandwidth removal. It keeps
counting all migrating DL tasks for cpuset task accounting, but reserves
destination DL bandwidth only for tasks that actually need a root-domain
bandwidth move.
Guopeng Zhang (2):
cgroup/cpuset: reset DL migration state on can_attach() failure
cgroup/cpuset: reserve DL bandwidth only for root-domain moves
include/linux/sched/deadline.h | 9 ++++++++
kernel/cgroup/cpuset-internal.h | 1 +
kernel/cgroup/cpuset.c | 39 ++++++++++++++++++---------------
kernel/sched/deadline.c | 13 ++++++++---
4 files changed, 41 insertions(+), 21 deletions(-)
---
Changes in v3:
- Patch 1: use common ret != 0 cleanup in cpuset_can_attach(), as
suggested by Waiman Long and Chen Ridong.
- Patch 2: drop task_cpu_possible_mask() / attach-target-mask handling
as suggested by Waiman Long.
- Patch 2: keep the change limited to reserving DL bandwidth only for
tasks that need a root-domain bandwidth move.
- Leave the broader can_attach()/attach() transaction model unchanged.
Changes in v2:
- Split the original change into two patches.
- Add a separate fix for resetting pending DL migration state on
cpuset_can_attach() failure.
- Clarify that nr_migrate_dl_tasks counts all migrating DL tasks for
cpuset task accounting, while sum_migrate_dl_bw only tracks bandwidth
needing destination root-domain reservation.
v2:
https://lore.kernel.org/all/20260507103310.35849-1-zhangguopeng@xxxxxxxxxx/
v1:
https://lore.kernel.org/all/20260421083449.95750-1-zhangguopeng@xxxxxxxxxx
--
2.43.0