Skip to content

Commit 386ef21

Browse files
Sebastian Andrzej SiewiorPeter Zijlstra
authored andcommitted
sched: Teach the forced-newidle balancer about CPU affinity limitation.
try_steal_cookie() looks at task_struct::cpus_mask to decide if the task could be moved to `this' CPU. It ignores that the task might be in a migration disabled section while not on the CPU. In this case the task must not be moved otherwise per-CPU assumption are broken. Use is_cpu_allowed(), as suggested by Peter Zijlstra, to decide if the a task can be moved. Fixes: d2dfa17 ("sched: Trivial forced-newidle balancer") Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/YjNK9El+3fzGmswf@linutronix.de
1 parent 5b6547e commit 386ef21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6006,7 +6006,7 @@ static bool try_steal_cookie(int this, int that)
60066006
if (p == src->core_pick || p == src->curr)
60076007
goto next;
60086008

6009-
if (!cpumask_test_cpu(this, &p->cpus_mask))
6009+
if (!is_cpu_allowed(p, this))
60106010
goto next;
60116011

60126012
if (p->core_occupation > dst->idle->core_occupation)

0 commit comments

Comments
 (0)