Skip to content
Commit 05037e5f authored by Kyle Meyer's avatar Kyle Meyer Committed by Yury Norov
Browse files

sched/topology: Optimize topology_span_sane()



Optimize topology_span_sane() by removing duplicate comparisons.

Since topology_span_sane() is called inside of for_each_cpu(), each
previous 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: default avatarKyle Meyer <kyle.meyer@hpe.com>
Reviewed-by: default avatarYury Norov <yury.norov@gmail.com>
Acked-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
parent 6802f934
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment