diff options
author | Mike Galbraith <efault@gmx.de> | 2011-04-29 08:36:50 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-05-16 11:01:17 +0200 |
commit | 61eadef6a9bde9ea62fda724a9cb501ce9bc925a (patch) | |
tree | 52ffdd4251e921681f086ec6c4e14ad6e5f9472d /kernel/sched_rt.c | |
parent | sched: Remove unused parameters from sched_fork() and wake_up_new_task() (diff) | |
download | linux-61eadef6a9bde9ea62fda724a9cb501ce9bc925a.tar.xz linux-61eadef6a9bde9ea62fda724a9cb501ce9bc925a.zip |
sched, rt: Update rq clock when unthrottling of an otherwise idle CPU
If an RT task is awakened while it's rt_rq is throttled, the time between
wakeup/enqueue and unthrottle/selection may be accounted as rt_time
if the CPU is idle. Set rq->skip_clock_update negative upon throttle
release to tell put_prev_task() that we need a clock update.
Reported-by: Thomas Giesel <skoe@directbox.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1304059010.7472.1.camel@marge.simson.net
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r-- | kernel/sched_rt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 19ecb3127379..0943ed7a4038 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -562,6 +562,13 @@ static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun) if (rt_rq->rt_throttled && rt_rq->rt_time < runtime) { rt_rq->rt_throttled = 0; enqueue = 1; + + /* + * Force a clock update if the CPU was idle, + * lest wakeup -> unthrottle time accumulate. + */ + if (rt_rq->rt_nr_running && rq->curr == rq->idle) + rq->skip_clock_update = -1; } if (rt_rq->rt_time || rt_rq->rt_nr_running) idle = 0; |