]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Fix get_push_task() vs migrate_disable()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 26 Aug 2021 13:37:38 +0000 (15:37 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 26 Aug 2021 17:02:00 +0000 (19:02 +0200)
commita163120cfea08f9eb7fbe5fd20a29b83ab4e7b37
tree9274cf04df39c1ef533537a713df7f57c92fef2f
parent33b766f043059bf93e3442a9732eff4fa8c1a097
sched: Fix get_push_task() vs migrate_disable()

push_rt_task() attempts to move the currently running task away if the
next runnable task has migration disabled and therefore is pinned on the
current CPU.

The current task is retrieved via get_push_task() which only checks for
nr_cpus_allowed == 1, but does not check whether the task has migration
disabled and therefore cannot be moved either. The consequence is a
pointless invocation of the migration thread which correctly observes
that the task cannot be moved.

Return NULL if the task has migration disabled and cannot be moved to
another CPU.

Fixes: 0ec40d14eea2f ("sched: Fix migrate_disable() vs rt/dl balancing")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210826133738.yiotqbtdaxzjsnfj@linutronix.de
kernel/sched/sched.h