Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752987AbbDFJLw (ORCPT ); Mon, 6 Apr 2015 05:11:52 -0400 Received: from mga09.intel.com ([134.134.136.24]:8558 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752773AbbDFJLp (ORCPT ); Mon, 6 Apr 2015 05:11:45 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,530,1422950400"; d="scan'208";a="477167880" From: Wanpeng Li To: Ingo Molnar , Peter Zijlstra Cc: Juri Lelli , linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH 4/7] sched/deadline: reschedule if stop task slip in after pull operations Date: Mon, 6 Apr 2015 16:53:16 +0800 Message-Id: <1428310399-13489-4-git-send-email-wanpeng.li@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428310399-13489-1-git-send-email-wanpeng.li@linux.intel.com> References: <1428310399-13489-1-git-send-email-wanpeng.li@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1640 Lines: 51 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 --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/