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 { 441 u64 runtime = sched_rt_runtime(rt_rq); 442 443 - if (runtime == RUNTIME_INF) 444 - return 0; 445 - 446 if (rt_rq->rt_throttled) 447 return rt_rq_throttled(rt_rq); 448 ··· 490 rt_rq = rt_rq_of_se(rt_se); 491 492 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 spin_unlock(&rt_rq->rt_runtime_lock); 497 } 498 }
··· 440 { 441 u64 runtime = sched_rt_runtime(rt_rq); 442 443 if (rt_rq->rt_throttled) 444 return rt_rq_throttled(rt_rq); 445 ··· 493 rt_rq = rt_rq_of_se(rt_se); 494 495 spin_lock(&rt_rq->rt_runtime_lock); 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 + } 501 spin_unlock(&rt_rq->rt_runtime_lock); 502 } 503 }