diff options
author | Peter Zijlstra <peterz@infradead.org> | 2015-01-05 11:18:11 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-01-14 13:34:20 +0100 |
commit | 9edfbfed3f544a7830d99b341f0c175995a02950 (patch) | |
tree | 58e117b481cc0fdfd9f4595d3fa73e66c689547a /kernel/sched/rt.c | |
parent | cebde6d681aa45f96111cfcffc1544cf2a0454ff (diff) | |
download | op-kernel-dev-9edfbfed3f544a7830d99b341f0c175995a02950.zip op-kernel-dev-9edfbfed3f544a7830d99b341f0c175995a02950.tar.gz |
sched/core: Rework rq->clock update skips
The original purpose of rq::skip_clock_update was to avoid 'costly' clock
updates for back to back wakeup-preempt pairs. The big problem with it
has always been that the rq variable is unaware of the context and
causes indiscrimiate clock skips.
Rework the entire thing and create a sense of context by only allowing
schedule() to skip clock updates. (XXX can we measure the cost of the
added store?)
By ensuring only schedule can ever skip an update, we guarantee we're
never more than 1 tick behind on the update.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: umgwanakikbuti@gmail.com
Link: http://lkml.kernel.org/r/20150105103554.432381549@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/rt.c')
-rw-r--r-- | kernel/sched/rt.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index ee15f5a..6725e3c 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -831,11 +831,14 @@ static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun) enqueue = 1; /* - * Force a clock update if the CPU was idle, - * lest wakeup -> unthrottle time accumulate. + * When we're idle and a woken (rt) task is + * throttled check_preempt_curr() will set + * skip_update and the time between the wakeup + * and this unthrottle will get accounted as + * 'runtime'. */ if (rt_rq->rt_nr_running && rq->curr == rq->idle) - rq->skip_clock_update = -1; + rq_clock_skip_update(rq, false); } if (rt_rq->rt_time || rt_rq->rt_nr_running) idle = 0; |