]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
sched: Teach the forced-newidle balancer about CPU affinity limitation.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 17 Mar 2022 14:51:32 +0000 (15:51 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:59:55 +0000 (11:59 +0200)
commit94092a5a5840b2a406e4f1713a15fdefabebccca
tree9f1595f66587d11db41ddbec435a8e936fc9bc19
parenta686c012548dfc1d49c97672c2d2cfa9af3cb0be
sched: Teach the forced-newidle balancer about CPU affinity limitation.

BugLink: https://bugs.launchpad.net/bugs/1969107
commit 386ef214c3c6ab111d05e1790e79475363abaa05 upstream.

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: d2dfa17bc7de6 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ff6505766565616deb65a203e62d4ca63c6c277b)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
kernel/sched/core.c