summaryrefslogtreecommitdiffstats
path: root/kernel/sched_rt.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2008-08-19 12:33:03 +0200
committerIngo Molnar <mingo@elte.hu>2008-08-19 13:10:09 +0200
commit6f0d5c390e4206dcb3804a5072a048fdb7d2b428 (patch)
tree60e25ec2076091c1deb9d414e84e276320be44bf /kernel/sched_rt.c
parentaf4491e51632d01fbc2b856ffa9ebcd4b38db68c (diff)
downloadkernel-crypto-6f0d5c390e4206dcb3804a5072a048fdb7d2b428.tar.gz
kernel-crypto-6f0d5c390e4206dcb3804a5072a048fdb7d2b428.tar.xz
kernel-crypto-6f0d5c390e4206dcb3804a5072a048fdb7d2b428.zip
sched: rt-bandwidth accounting fix
It fixes an accounting bug where we would continue accumulating runtime even though the bandwidth control is disabled. This would lead to very long throttle periods once bandwidth control gets turned on again. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r--kernel/sched_rt.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 998ba54b454..77340b04a53 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -438,9 +438,6 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
{
u64 runtime = sched_rt_runtime(rt_rq);
- if (runtime == RUNTIME_INF)
- return 0;
-
if (rt_rq->rt_throttled)
return rt_rq_throttled(rt_rq);
@@ -491,9 +488,11 @@ static void update_curr_rt(struct rq *rq)
rt_rq = rt_rq_of_se(rt_se);
spin_lock(&rt_rq->rt_runtime_lock);
- rt_rq->rt_time += delta_exec;
- if (sched_rt_runtime_exceeded(rt_rq))
- resched_task(curr);
+ if (sched_rt_runtime(rt_rq) != RUNTIME_INF) {
+ rt_rq->rt_time += delta_exec;
+ if (sched_rt_runtime_exceeded(rt_rq))
+ resched_task(curr);
+ }
spin_unlock(&rt_rq->rt_runtime_lock);
}
}