Commit 1293771e authored by Peter Zijlstra's avatar Peter Zijlstra

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: default avatarOleksandr Natalenko <oleksandr@natalenko.name>
Debugged-by: default avatarValentin Schneider <valentin.schneider@arm.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
parent d707faa6
......@@ -1911,7 +1911,7 @@ static int migration_cpu_stop(void *data)
* and we should be valid again. Nothing to do.
*/
if (!pending) {
WARN_ON_ONCE(!is_cpu_allowed(p, cpu_of(rq)));
WARN_ON_ONCE(!cpumask_test_cpu(task_cpu(p), &p->cpus_mask));
goto out;
}
......@@ -1950,7 +1950,7 @@ static int migration_cpu_stop(void *data)
* valid again. Nothing to do.
*/
if (!pending) {
WARN_ON_ONCE(!is_cpu_allowed(p, cpu_of(rq)));
WARN_ON_ONCE(!cpumask_test_cpu(task_cpu(p), &p->cpus_mask));
goto out;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment