Commit 04890c03 authored by Mel Gorman's avatar Mel Gorman Committed by Zheng Zengkai
Browse files

sched/fair: Merge select_idle_core/cpu()

mainline inclusion
from mainline-5.12-rc1
commit 9fe1f127
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I41A4K
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9fe1f127b913318c631d0041ecf71486e38c2c2d



---------------------------

Both select_idle_core() and select_idle_cpu() do a loop over the same
cpumask. Observe that by clearing the already visited CPUs, we can
fold the iteration and iterate a core at a time.

All we need to do is remember any non-idle CPU we encountered while
scanning for an idle core. This way we'll only iterate every CPU once.

Signed-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Reviewed-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20210127135203.19633-5-mgorman@techsingularity.net


Signed-off-by: default avatarZheng Zucheng <zhengzucheng@huawei.com>

Conflicts:
	kernel/sched/fair.c
Reviewed-by: default avatarChen Hui <judy.chenhui@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 4e2d845f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment