[PATCH v1 5/8] sched/topology: Avoid redundant O(N^3) group capacity walks and unused allocations in build_sched_domains()
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Oct 15 08:43:40 PDT 2026
> During sequential CPU hotplug on large systems, build_sched_domains() is
> invoked for every CPU offline and online step. Two bottlenecks in the
> domain construction path scale poorly with CPU count:
>
> 1. On non-overlapping topology levels, all CPUs sharing a domain span
> share the same circular ring of sched_group instances, and on
> overlapping NUMA levels, groups with identical spans share
> sched_group_capacity (sgc). However, init_sched_groups_capacity()
> walks the entire group ring for every CPU in the domain and repeatedly
> recomputes group_weight, cores (walking the group cpumask and clearing
> cpu_smt_mask), and asym_prefer_cpu (O(N^3) bitmap operations per
> hotplug step). Similarly, init_overlap_sched_group() recomputes
> build_balance_mask() and cpumask_weight(sg_span) even when the shared
> sgc was already initialized.
>
> [ ... ]
> Total: 7.66 s -> 5.29 s (-30.9%)
> build_sched_domains() (cpu511 offline / online):
> 11.69 ms -> 5.61 ms (-52.0%) / 12.24 ms -> 5.84 ms (-52.3%)
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin at soleen.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015153331.1872641-1-pasha.tatashin@soleen.com?part=5
More information about the kexec
mailing list