]> www.infradead.org Git - users/dwmw2/linux.git/commit
sched: Fix migration_cpu_stop() WARN
authorPeter Zijlstra <peterz@infradead.org>
Tue, 17 Nov 2020 11:14:51 +0000 (12:14 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 19 Nov 2020 10:25:45 +0000 (11:25 +0100)
commit1293771e4353c148d5f6908fb32d1c1cfd653e47
treeb1a0a633c573295bf4430264448e9c8ecee5e02f
parentd707faa64d03d26b529cc4aea59dab1b016d4d33
sched: Fix migration_cpu_stop() WARN

Oleksandr reported hitting the WARN in the 'task_rq(p) != rq' branch
of migration_cpu_stop(). Valentin noted that using cpu_of(rq) in that
case is just plain wrong to begin with, since per the earlier branch
that isn't the actual CPU of the task.

Replace both instances of is_cpu_allowed() by a direct p->cpus_mask
test using task_cpu().

Reported-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Debugged-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
kernel/sched/core.c