aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWanpeng Li <[email protected]>2014-11-26 08:44:01 +0800
committerIngo Molnar <[email protected]>2015-02-04 07:52:25 +0100
commita7bebf488791aa1036f3e6629daf01d01f705dcb (patch)
tree5a85ca285a7e66581e8f97094bafac7cfa5b02cc
parent4c195c8a1967ff8bee13a811518a99db04618ab7 (diff)
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 <[email protected]> Acked-by: Juri Lelli <[email protected]> [ Rewrote the changelog and comment. ] Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Kirill Tkhai <[email protected]> Cc: Linus Torvalds <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--kernel/sched/deadline.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index e0e9c2986976..7b684f9341a5 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);
}