Messages in this thread Patch in this message |  | | From | Yury Norov <> | | Subject | [PATCH 2/2] sched/topology: optimize topology_span_sane() | | Date | Fri, 2 Aug 2024 10:57:43 -0700 |
| |
The function may call cpumask_equal with tl->mask(cpu) == tl->mask(i), even when cpu != i. In such case, cpumask_equal() would always return true, and we can proceed to the next iteration immediately.
Signed-off-by: Yury Norov <yury.norov@gmail.com> --- kernel/sched/topology.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 754ad5fa3c99..571759606954 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -2368,6 +2368,8 @@ static bool topology_span_sane(struct sched_domain_topology_level *tl, */ for_each_cpu_from(i, cpu_map) { mi = tl->mask(i); + if (mi == mc) + continue; /* * We should 'and' all those masks with 'cpu_map' to exactly -- 2.43.0
|  |