mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
sched/walt: do not perform unnecessary migrations
It is possible that the fallback destination cpu is the same as the current cpu. In this case, this is an inappropriate migration request, causing a double lock unbalance error in walt_detach_task. Prevent this case by preventing a task that is not going to be migrated from being passed to __migrate_task, and instead detach the task and add it to the list to be added back later. Change-Id: I26f57bf52ca9a7bfe221d02d9ccb353d8c8d27ff Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
This commit is contained in:
parent
e20d764ffa
commit
b71791171e
|
|
@ -146,13 +146,22 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf)
|
|||
|
||||
/* Find suitable destination for @next */
|
||||
dest_cpu = select_fallback_rq(dead_rq->cpu, next);
|
||||
rq = __migrate_task(rq, rf, next, dest_cpu);
|
||||
if (rq != dead_rq) {
|
||||
rq_unlock(rq, rf);
|
||||
rq = dead_rq;
|
||||
*rf = orf;
|
||||
rq_relock(rq, rf);
|
||||
|
||||
if (cpu_of(rq) != dest_cpu) {
|
||||
/* only perform a required migration */
|
||||
rq = __migrate_task(rq, rf, next, dest_cpu);
|
||||
|
||||
if (rq != dead_rq) {
|
||||
rq_unlock(rq, rf);
|
||||
rq = dead_rq;
|
||||
*rf = orf;
|
||||
rq_relock(rq, rf);
|
||||
}
|
||||
} else {
|
||||
detach_one_task_core(next, rq, &percpu_kthreads);
|
||||
num_pinned_kthreads += 1;
|
||||
}
|
||||
|
||||
raw_spin_unlock(&next->pi_lock);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user