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>

authored by Peter Zijlstra and committed by Ingo Molnar cc2991cf f3ade837

+5 -6
+5 -6
kernel/sched_rt.c
··· 440 440 { 441 441 u64 runtime = sched_rt_runtime(rt_rq); 442 442 443 - if (runtime == RUNTIME_INF) 444 - return 0; 445 - 446 443 if (rt_rq->rt_throttled) 447 444 return rt_rq_throttled(rt_rq); 448 445 ··· 490 493 rt_rq = rt_rq_of_se(rt_se); 491 494 492 495 spin_lock(&rt_rq->rt_runtime_lock); 493 - rt_rq->rt_time += delta_exec; 494 - if (sched_rt_runtime_exceeded(rt_rq)) 495 - resched_task(curr); 496 + if (sched_rt_runtime(rt_rq) != RUNTIME_INF) { 497 + rt_rq->rt_time += delta_exec; 498 + if (sched_rt_runtime_exceeded(rt_rq)) 499 + resched_task(curr); 500 + } 496 501 spin_unlock(&rt_rq->rt_runtime_lock); 497 502 } 498 503 }