Skip to content

Commit 02dbb72

Browse files
Gautham R. ShenoyIngo Molnar
authored andcommitted
sched/fair: Fix clearing of has_idle_cores flag in select_idle_cpu()
In commit: 9fe1f12 ("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. Fixes: 9fe1f12 ("sched/fair: Merge select_idle_core/cpu()") Signed-off-by: Gautham R. Shenoy <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Vincent Guittot <[email protected]> Reviewed-by: Srikar Dronamraju <[email protected]> Acked-by: Mel Gorman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 88b0639 commit 02dbb72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6217,7 +6217,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool
62176217
}
62186218

62196219
if (has_idle_core)
6220-
set_idle_cores(this, false);
6220+
set_idle_cores(target, false);
62216221

62226222
if (sched_feat(SIS_PROP) && !has_idle_core) {
62236223
time = cpu_clock(this) - time;

0 commit comments

Comments
 (0)