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/numa: Stop an exhastive search if an idle core is found

In update_numa_stats() we try to find an idle cpu on the NUMA node,
preferably an idle core. we can stop looking for the next idle core
or idle cpu after finding an idle core. But we can't stop the
whole loop of scanning the CPU, because we need to calculate
approximate NUMA stats at a point in time. For example,
the src and dst nr_running is needed by task_numa_find_cpu().

Signed-off-by: Hao Jia <jiahao.os@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Link: https://lore.kernel.org/r/20221216062406.7812-2-jiahao.os@bytedance.com

authored by

Hao Jia and committed by
Peter Zijlstra
feaed763 904cbab7

+1 -1
+1 -1
kernel/sched/fair.c
··· 1804 1804 ns->nr_running += rq->cfs.h_nr_running; 1805 1805 ns->compute_capacity += capacity_of(cpu); 1806 1806 1807 - if (find_idle && !rq->nr_running && idle_cpu(cpu)) { 1807 + if (find_idle && idle_core < 0 && !rq->nr_running && idle_cpu(cpu)) { 1808 1808 if (READ_ONCE(rq->numa_migrate_on) || 1809 1809 !cpumask_test_cpu(cpu, env->p->cpus_ptr)) 1810 1810 continue;