[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a7bebf488791aa1036f3e6629daf01d01f705dcb@git.kernel.org>
Date: Wed, 4 Feb 2015 06:34:52 -0800
From: tip-bot for Wanpeng Li <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: peterz@...radead.org, wanpeng.li@...ux.intel.com, mingo@...nel.org,
hpa@...or.com, torvalds@...ux-foundation.org, tglx@...utronix.de,
ktkhai@...allels.com, linux-kernel@...r.kernel.org,
juri.lelli@....com
Subject: [tip:sched/core] sched/deadline:
Fix hrtick for a non-leftmost task
Commit-ID: a7bebf488791aa1036f3e6629daf01d01f705dcb
Gitweb: http://git.kernel.org/tip/a7bebf488791aa1036f3e6629daf01d01f705dcb
Author: Wanpeng Li <wanpeng.li@...ux.intel.com>
AuthorDate: Wed, 26 Nov 2014 08:44:01 +0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 4 Feb 2015 07:52:25 +0100
sched/deadline: Fix hrtick for a non-leftmost task
After update_curr_dl() the current task might not be the leftmost task
anymore. In that case do not start a new hrtick for it.
In this case NEED_RESCHED will be set and the next schedule will start
the hrtick for the new task if and when appropriate.
Signed-off-by: Wanpeng Li <wanpeng.li@...ux.intel.com>
Acked-by: Juri Lelli <juri.lelli@....com>
[ Rewrote the changelog and comment. ]
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Kirill Tkhai <ktkhai@...allels.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Link: http://lkml.kernel.org/r/1416962647-76792-2-git-send-email-wanpeng.li@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/deadline.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index e0e9c29..7b684f9 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1073,7 +1073,13 @@ static void task_tick_dl(struct rq *rq, struct task_struct *p, int queued)
{
update_curr_dl(rq);
- if (hrtick_enabled(rq) && queued && p->dl.runtime > 0)
+ /*
+ * Even when we have runtime, update_curr_dl() might have resulted in us
+ * not being the leftmost task anymore. In that case NEED_RESCHED will
+ * be set and schedule() will start a new hrtick for the next task.
+ */
+ if (hrtick_enabled(rq) && queued && p->dl.runtime > 0 &&
+ is_leftmost(p, &rq->dl))
start_hrtick_dl(rq, p);
}
--
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