Skip to content

Commit

Permalink
sched: rt-bandwidth accounting fix
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Aug 28, 2008
1 parent f3ade83 commit cc2991c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions kernel/sched_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,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);

Expand Down Expand Up @@ -493,9 +490,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);
}
}
Expand Down

0 comments on commit cc2991c

Please sign in to comment.