diff options
| author | Stefan Guendhoer <stefan@guendhoer.com> | 2016-01-07 22:12:48 +0000 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-08-26 20:20:29 +0200 |
| commit | 7c12352decbefc212d56a633906dce5936ef94bb (patch) | |
| tree | a3439c886cb2e7eb82827b8ea6adc5b2318897bc | |
| parent | 4c75e07083de3652d89ebd8e9c18c13ba5298ac1 (diff) | |
sched/rt: Reduce rq lock contention by eliminating locking of non-feasible target
| -rw-r--r-- | kernel/sched/rt.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index fb7892646..692fb1e77 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2290,6 +2290,16 @@ static struct rq *find_lock_lowest_rq_mtk(struct task_struct *task, struct rq *r lowest_rq = cpu_rq(cpu); + if (lowest_rq->rt.highest_prio.curr <= task->prio) { + /* + * Target rq has tasks of equal or higher priority, + * retrying does not release any lock and is unlikely + * to yield a different result. + */ + lowest_rq = NULL; + break; + } + /* if the prio of this runqueue changed, try again */ if (double_lock_balance(rq, lowest_rq)) { /* |
