diff options
author | Peter Zijlstra <peterz@infradead.org> | 2011-10-18 22:03:48 +0200 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-03-13 12:39:44 -0500 |
commit | fd4b2ef4e55f9bfe91cdf2a28199911628f2b479 (patch) | |
tree | 216d34d145ae1919190b69be2c22daa0aa7008f8 /kernel/sched_rt.c | |
parent | a565403ebe81ed70ffcbdc76626865d7eecd89ad (diff) |
sched: Keep period timer ticking when throttling active
When a runqueue is throttled we cannot disable the period timer
because that timer is the only way to undo the throttling.
We got stale throttling entries when a rq was throttled and then the
global sysctl was disabled, which stopped the timer.
[ tglx: Preliminary changelog ]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r-- | kernel/sched_rt.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 78fcacf8715e..40d97e1bf9d3 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -580,12 +580,9 @@ static inline int balance_runtime(struct rt_rq *rt_rq) static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun) { - int i, idle = 1; + int i, idle = 1, throttled = 0; const struct cpumask *span; - if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF) - return 1; - span = sched_rt_period_mask(); for_each_cpu(i, span) { int enqueue = 0; @@ -620,12 +617,17 @@ static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun) if (!rt_rq_throttled(rt_rq)) enqueue = 1; } + if (rt_rq->rt_throttled) + throttled = 1; if (enqueue) sched_rt_rq_enqueue(rt_rq); raw_spin_unlock(&rq->lock); } + if (!throttled && (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF)) + return 1; + return idle; } @@ -686,7 +688,8 @@ static void update_curr_rt(struct rq *rq) if (unlikely((s64)delta_exec < 0)) delta_exec = 0; - schedstat_set(curr->se.statistics.exec_max, max(curr->se.statistics.exec_max, delta_exec)); + schedstat_set(curr->se.statistics.exec_max, + max(curr->se.statistics.exec_max, delta_exec)); curr->se.sum_exec_runtime += delta_exec; account_group_exec_runtime(curr, delta_exec); |