sched/core: Adjusting the order of scanning CPU
authorHao Jia <jiahao.os@bytedance.com>
Fri, 16 Dec 2022 06:24:06 +0000 (14:24 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 27 Dec 2022 11:52:17 +0000 (12:52 +0100)
commit8589018acc65e5ddfd111f0a7ee85f9afde3a830
tree051b7dc295f0544f1997b774e268e30a0d388a10
parentfeaed76376fd612b9450ad1251aec20a63ccfe92
sched/core: Adjusting the order of scanning CPU

When select_idle_capacity() starts scanning for an idle CPU, it starts
with target CPU that has already been checked in select_idle_sibling().
So we start checking from the next CPU and try the target CPU at the end.
Similarly for task_numa_assign(), we have just checked numa_migrate_on
of dst_cpu, so start from the next CPU. This also works for
steal_cookie_task(), the first scan must fail and start directly
from the next one.

Signed-off-by: Hao Jia <jiahao.os@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Link: https://lore.kernel.org/r/20221216062406.7812-3-jiahao.os@bytedance.com
kernel/sched/core.c
kernel/sched/fair.c