Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched/fair: Drop useless cpumask_empty() in find_energy_efficient_cpu()

cpumask_empty() call is O(N) and useless because the previous
cpumask_and() returns false for empty 'cpus'. Drop it.

Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://patch.msgid.link/20251207040543.407695-1-yury.norov@gmail.com

authored by

Yury Norov (NVIDIA) and committed by
Peter Zijlstra
ff1de90d 6ab7973f

+1 -3
+1 -3
kernel/sched/fair.c
··· 8359 8359 int max_spare_cap_cpu = -1; 8360 8360 int fits, max_fits = -1; 8361 8361 8362 - cpumask_and(cpus, perf_domain_span(pd), cpu_online_mask); 8363 - 8364 - if (cpumask_empty(cpus)) 8362 + if (!cpumask_and(cpus, perf_domain_span(pd), cpu_online_mask)) 8365 8363 continue; 8366 8364 8367 8365 /* Account external pressure for the energy estimation */