Commit 6f0d5c390e4206dcb3804a5072a048fdb7d2b428
Committed by
Ingo Molnar
1 parent
af4491e516
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 5 additions and 6 deletions Side-by-side Diff
kernel/sched_rt.c
... | ... | @@ -438,9 +438,6 @@ |
438 | 438 | { |
439 | 439 | u64 runtime = sched_rt_runtime(rt_rq); |
440 | 440 | |
441 | - if (runtime == RUNTIME_INF) | |
442 | - return 0; | |
443 | - | |
444 | 441 | if (rt_rq->rt_throttled) |
445 | 442 | return rt_rq_throttled(rt_rq); |
446 | 443 | |
... | ... | @@ -491,9 +488,11 @@ |
491 | 488 | rt_rq = rt_rq_of_se(rt_se); |
492 | 489 | |
493 | 490 | spin_lock(&rt_rq->rt_runtime_lock); |
494 | - rt_rq->rt_time += delta_exec; | |
495 | - if (sched_rt_runtime_exceeded(rt_rq)) | |
496 | - resched_task(curr); | |
491 | + if (sched_rt_runtime(rt_rq) != RUNTIME_INF) { | |
492 | + rt_rq->rt_time += delta_exec; | |
493 | + if (sched_rt_runtime_exceeded(rt_rq)) | |
494 | + resched_task(curr); | |
495 | + } | |
497 | 496 | spin_unlock(&rt_rq->rt_runtime_lock); |
498 | 497 | } |
499 | 498 | } |