[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1418920263-21358-1-git-send-email-pang.xunlei@linaro.org>
Date: Fri, 19 Dec 2014 00:31:03 +0800
From: Xunlei Pang <pang.xunlei@...aro.org>
To: linux-kernel@...r.kernel.org
Cc: Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...il.com>,
Xunlei Pang <pang.xunlei@...aro.org>
Subject: [PATCH] sched/deadline: Add update_rq_clock() in yield_task_dl()
yield_task_dl() calls update_curr_dl() which calls start_dl_timer()
to throttle current task. But yield_task_dl() doesn't update the rq
clock which will cause start_dl_timer() to set the wrong dl_timer
which may be much later than current deadline time.
For instance, in systems with 100HZ tick, if there're few dl-tasks,
then rq clock will mainly depend on the tick to update its value.
If we choose the CONFIG_NO_HZ_FULL_ALL feature, things may get even
worse.
Moreover, there're some statistics in update_curr_dl() also relying
on rq clock, like rq_clock_task().
Thus, in yield_task_dl(), we should add update_rq_clock() before
update_curr_dl().
Signed-off-by: Xunlei Pang <pang.xunlei@...aro.org>
---
kernel/sched/deadline.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index e5db8c6..5648e62 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -915,7 +915,11 @@ static void yield_task_dl(struct rq *rq)
rq->curr->dl.dl_yielded = 1;
p->dl.runtime = 0;
}
+
+ update_rq_clock(rq);
update_curr_dl(rq);
+ /* Will go to schedule(), to avoid another clock update. */
+ rq->skip_clock_update = 1;
}
#ifdef CONFIG_SMP
--
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