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: Simplify task_numa_find_cpu()

Use for_each_cpu_and() and drop some housekeeping code.

Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Reviewed-by: Phil Auld <pauld@redhat.com>
Link: https://patch.msgid.link/20251207033037.399608-1-yury.norov@gmail.com

authored by

Yury Norov (NVIDIA) and committed by
Peter Zijlstra
0ab25ea2 ff1de90d

+2 -5
+2 -5
kernel/sched/fair.c
··· 2494 2494 maymove = !load_too_imbalanced(src_load, dst_load, env); 2495 2495 } 2496 2496 2497 - for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) { 2498 - /* Skip this CPU if the source task cannot migrate */ 2499 - if (!cpumask_test_cpu(cpu, env->p->cpus_ptr)) 2500 - continue; 2501 - 2497 + /* Skip CPUs if the source task cannot migrate */ 2498 + for_each_cpu_and(cpu, cpumask_of_node(env->dst_nid), env->p->cpus_ptr) { 2502 2499 env->dst_cpu = cpu; 2503 2500 if (task_numa_compare(env, taskimp, groupimp, maymove)) 2504 2501 break;