Re: [PATCH v2 2/2] sched/topology: Optimize topology_span_sane()
From: Valentin Schneider
Date: Mon Apr 15 2024 - 07:50:30 EST
On 10/04/24 16:33, Kyle Meyer wrote:
> Optimize topology_span_sane() by removing duplicate comparisons.
>
> Since topology_span_sane() is called inside of for_each_cpu(), each
> pervious CPU has already been compared against every other CPU. The
> current CPU only needs to be compared against higher-numbered CPUs.
>
> The total number of comparisons is reduced from N * (N - 1) to
> N * (N - 1) / 2 on each non-NUMA scheduling domain level.
>
> Signed-off-by: Kyle Meyer <kyle.meyer@xxxxxxx>
> Reviewed-by: Yury Norov <yury.norov@xxxxxxxxx>
> Acked-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
Reviewed-by: Valentin Schneider <vschneid@xxxxxxxxxx>