linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2]  sched/dl: Reduce push_dl_task() retries
@ 2018-10-15 19:42 Peng Hao
  0 siblings, 0 replies; only message in thread
From: Peng Hao @ 2018-10-15 19:42 UTC (permalink / raw)
  To: mingo, peterz; +Cc: rostedt, andrea.parri, linux-kernel, juri.lelli, Peng Hao

Improve push_dl_task() by propagating the double_lock_balance()
usage from find_lock_later_rq(), thereby reducing the number
of cases where we have to assume rq->lock was dropped.

Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 kernel/sched/deadline.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 997ea7b..8e875ec 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1979,7 +1979,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq)
 				     !dl_task(task) ||
 				     !task_on_rq_queued(task))) {
 				double_unlock_balance(rq, later_rq);
-				later_rq = NULL;
+				later_rq = RETRY_TASK;
 				break;
 			}
 		}
@@ -2063,7 +2063,9 @@ static int push_dl_task(struct rq *rq)
 
 	/* Will lock the rq it'll find */
 	later_rq = find_lock_later_rq(next_task, rq);
-	if (!later_rq) {
+	if (!later_rq)
+		goto out;
+	if (later_rq == RETRY_TASK) {
 		struct task_struct *task;
 
 		/*
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-15 11:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-15 19:42 [PATCH v2] sched/dl: Reduce push_dl_task() retries Peng Hao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).