Commit 05037e5
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: Kyle Meyer <kyle.meyer@hpe.com>
Reviewed-by: Yury Norov <yury.norov@gmail.com>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Yury Norov <yury.norov@gmail.com>1 parent 6802f93 commit 05037e5
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2347 | 2347 | | |
2348 | 2348 | | |
2349 | 2349 | | |
2350 | | - | |
| 2350 | + | |
2351 | 2351 | | |
2352 | 2352 | | |
2353 | 2353 | | |
| |||
2359 | 2359 | | |
2360 | 2360 | | |
2361 | 2361 | | |
2362 | | - | |
2363 | | - | |
2364 | | - | |
| 2362 | + | |
2365 | 2363 | | |
2366 | 2364 | | |
2367 | 2365 | | |
| |||
0 commit comments