lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1539632566-4440-1-git-send-email-peng.hao2@zte.com.cn>
Date:   Tue, 16 Oct 2018 03:42:46 +0800
From:   Peng Hao <peng.hao2@....com.cn>
To:     mingo@...hat.com, peterz@...radead.org
Cc:     rostedt@...dmis.org, andrea.parri@...rulasolutions.com,
        linux-kernel@...r.kernel.org, juri.lelli@...il.com,
        Peng Hao <peng.hao2@....com.cn>
Subject: [PATCH v2]  sched/dl: Reduce push_dl_task() retries

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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ