sched/fair: Fix clearing of has_idle_cores flag
PATCH v2 1/1 sched/fair: Fix clearing of has_idle_cores flag
From: "Gautham R. Shenoy" <[email protected]>
In commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()"), in select_idle_cpu(), we check if an idle core is present in the LLC of the target CPU via the flag "has_idle_cores". We look for the idle core in select_idle_cores(). If select_idle_cores() isn't able to find an idle core/CPU, we need to unset the has_idle_cores flag in the LLC of the target to prevent other CPUs from going down this route.
However, the current code is unsetting it in the LLC of the current CPU instead of the target CPU. This patch fixes this issue.
---
v1 --> v2 : Rebased against tip/sched/core
kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -6217,7 +6217,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool }if (has_idle_core) -set_idle_cores (this, false); +set_idle_cores (target, false);if (sched_feat (SIS_PROP ) && !has_idle_core) { time =cpu_clock (this) - time;
Signature · 1 line
1.9.4
[tip: sched/urgent] sched/fair: Fix clearing of has_idle_cores flag in select_idle_cpu()
The following commit has been merged into the sched/urgent branch of tip:
The following commit has been merged into the sched/urgent branch of tip:
Commit-ID: 02dbb7246c5bbbbe1607ebdc546ba5c454a664b1 Gitweb: https://git.kernel.org/tip/02dbb7246c5bbbbe1607ebdc546ba5c454a664b1 Author: Gautham R. Shenoy <[email protected]> AuthorDate: Tue, 11 May 2021 20:46:09 +05:30 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 12 May 2021 10:41:28 +02:00
sched/fair: Fix clearing of has_idle_cores flag in select_idle_cpu()
In commit:
9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()")
in select_idle_cpu(), we check if an idle core is present in the LLC of the target CPU via the flag "has_idle_cores". We look for the idle core in select_idle_cores(). If select_idle_cores() isn't able to find an idle core/CPU, we need to unset the has_idle_cores flag in the LLC of the target to prevent other CPUs from going down this route.
However, the current code is unsetting it in the LLC of the current CPU instead of the target CPU. This patch fixes this issue.
--- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -6217,7 +6217,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool }if (has_idle_core) -set_idle_cores (this, false); +set_idle_cores (target, false);if (sched_feat (SIS_PROP ) && !has_idle_core) { time =cpu_clock (this) - time;
Peter Zijlstra
maintainerQuoted 9 lines · Gautham R. Shenoy
From: "Gautham R. Shenoy" <[email protected]>
In commit
9fe1f127b913("sched/fair: Merge select_idle_core/cpu()"), inselect_idle_cpu(), we check if an idle core is present in the LLC of the target CPU via the flag "has_idle_cores". We look for the idle core inselect_idle_cores(). Ifselect_idle_cores()isn't able to find an idle core/CPU, we need to unset thehas_idle_coresflag in the LLC of the target to prevent other CPUs from going down this route.
Quoted 8 lines
However, the current code is unsetting it in the LLC of the current CPU instead of the target CPU. This patch fixes this issue.
Fixes Commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()")Acked-by Mel Gorman <[email protected]>Reviewed-by Vincent Guittot <[email protected]>Reviewed-by Srikar Dronamraju <[email protected]>Signed-off-by Gautham R. Shenoy <[email protected]>
Thanks!