Re: [PATCH v4 0/2] Improving topology_span_sane
From: Valentin Schneider
Date: Thu Mar 06 2025 - 09:33:28 EST
On 04/03/25 10:08, Steve Wahl wrote:
> toplogy_span_sane() has an O(N^2) algorithm that takes an inordinate
> amount of time on systems with a large number of cpus.
>
> The first patch in this series replaces the algorithm used with a O(N)
> method that should exactly duplicate the previous code's results.
>
> The second patch simplifies the first, taking a similar amount of time
> to run, but potentially has different results than previous code under
> situations believed to not truly exist, like a CPU not being included
> in its own span.
>
Had to hack up arch_topology.c some more to replicate the setup described
in
ccf74128d66c ("sched/topology: Assert non-NUMA topology masks don't (partially) overlap")
but eventually go there, and it was correctly caught by topology_span_sane().
Thanks!
Reviewed-by: Valentin Schneider <vschneid@xxxxxxxxxx>
Tested-by: Valentin Schneider <vschneid@xxxxxxxxxx>