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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon,  6 Apr 2015 16:53:16 +0800
From:	Wanpeng Li <wanpeng.li@...ux.intel.com>
To:	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>
Cc:	Juri Lelli <juri.lelli@....com>, linux-kernel@...r.kernel.org,
	Wanpeng Li <wanpeng.li@...ux.intel.com>
Subject: [PATCH 4/7] sched/deadline: reschedule if stop task slip in after pull operations

pull_dl_task can drop (and re-acquire) rq->lock, this means a stop task 
can slip in, in which case we need to reschedule. This patch add the 
reschedule when the scenario occurs.

Signed-off-by: Wanpeng Li <wanpeng.li@...ux.intel.com>
---
 kernel/sched/deadline.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index b8b9355..844da0f 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1739,7 +1739,13 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p)
 	if (!task_on_rq_queued(p) || rq->dl.dl_nr_running)
 		return;
 
-	if (pull_dl_task(rq))
+	/*
+	 * pull_dl_task() can drop (and re-acquire) rq->lock; this
+	 * means a stop task can slip in, in which case we need to
+	 * reschedule.
+	 */
+	if (pull_dl_task(rq) ||
+		(rq->stop && task_on_rq_queued(rq->stop)))
 		resched_curr(rq);
 }
 
@@ -1786,6 +1792,14 @@ static void prio_changed_dl(struct rq *rq, struct task_struct *p,
 			pull_dl_task(rq);
 
 		/*
+		 * pull_dl_task() can drop (and re-acquire) rq->lock; this
+		 * means a stop task can slip in, in which case we need to
+		 * reschedule.
+		 */
+		if (rq->stop && task_on_rq_queued(rq->stop))
+			resched_curr(rq);
+
+		/*
 		 * If we now have a earlier deadline task than p,
 		 * then reschedule, provided p is still on this
 		 * runqueue.
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ