The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/3] cgroup/cpuset: Speed up v2 mask updates and domain rebuilds
@ 2026-11-23 12:45 Chuyi Zhou
  2026-11-23 12:45 ` [PATCH 1/3] cgroup/cpuset: Skip the sched domain attribute allocation on v2 Chuyi Zhou
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chuyi Zhou @ 2026-11-23 12:45 UTC (permalink / raw)
  To: longman, tj, hannes, mkoutny, ridong.chen; +Cc: linux-kernel, Chuyi Zhou

We run high-density container workloads on large bare-metal hosts using
cgroup v2. We may configure many root partitions on a single host.

Changing a member's cpuset.cpus scans its siblings under cpuset_mutex,
so the cost of a write grows with the number of children under the same
parent. Creating or resizing a root partition can trigger a scheduling
domain rebuild. The rebuild checks every pair of partition CPU masks for
overlap, so the number of checks grows quadratically with the number of
partitions.

This series speeds up cpuset.cpus updates and scheduling domain rebuilds
on these hosts. The timings below are from a dual-socket Xeon Platinum
8582C with 240 online CPUs.

1. All v2 partitions use the default scheduling domain attributes.
   Passing NULL saves one array allocation per rebuild and one attribute
   initialization per partition.

2. Check each partition's effective CPUs against the union of the masks
   already seen to detect overlap in a single pass. With 128 root
   partitions, median time in generate_sched_domains() fell from 42.9 us
   to 3.14 us.

3. Skip the sibling scan when a member's cpuset.cpus.exclusive stays
   empty. With 2,048 children under one parent and one sleeping task in
   the target cpuset, median write latency for cpuset.cpus fell from
   24.1 us to 0.85 us.

Thanks,
Chuyi

Chuyi Zhou (3):
  cgroup/cpuset: Skip the sched domain attribute allocation on v2
  cgroup/cpuset: Check v2 partition overlap in a single pass
  cgroup/cpuset: Skip sibling checks for v2 members without exclusive
    CPUs

 kernel/cgroup/cpuset-internal.h |  1 -
 kernel/cgroup/cpuset.c          | 74 +++++++++++++++++----------------
 2 files changed, 39 insertions(+), 36 deletions(-)


base-commit: a6ca40399708c4322e87448f6c47da7192d72895
-- 
2.20.1

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

end of thread, other threads:[~2026-11-23 12:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 12:45 [PATCH 0/3] cgroup/cpuset: Speed up v2 mask updates and domain rebuilds Chuyi Zhou
2026-11-23 12:45 ` [PATCH 1/3] cgroup/cpuset: Skip the sched domain attribute allocation on v2 Chuyi Zhou
2026-11-23 12:45 ` [PATCH 2/3] cgroup/cpuset: Check v2 partition overlap in a single pass Chuyi Zhou
2026-11-23 12:45 ` [PATCH 3/3] cgroup/cpuset: Skip sibling checks for v2 members without exclusive CPUs Chuyi Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox