Commit 0b148fa04852859972abbf848177b92daeef138a
Committed by
Ingo Molnar
1 parent
6f0d5c390e
sched: rt-bandwidth group disable fixes
More extensive disable of bandwidth control. It allows sysctl_sched_rt_runtime to disable full group bandwidth control. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 2 changed files with 12 additions and 2 deletions Side-by-side Diff
kernel/sched.c
... | ... | @@ -204,11 +204,13 @@ |
204 | 204 | rt_b->rt_period_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ; |
205 | 205 | } |
206 | 206 | |
207 | +static inline int rt_bandwidth_enabled(void); | |
208 | + | |
207 | 209 | static void start_rt_bandwidth(struct rt_bandwidth *rt_b) |
208 | 210 | { |
209 | 211 | ktime_t now; |
210 | 212 | |
211 | - if (rt_b->rt_runtime == RUNTIME_INF) | |
213 | + if (rt_bandwidth_enabled() && rt_b->rt_runtime == RUNTIME_INF) | |
212 | 214 | return; |
213 | 215 | |
214 | 216 | if (hrtimer_active(&rt_b->rt_period_timer)) |
... | ... | @@ -837,6 +839,11 @@ |
837 | 839 | return RUNTIME_INF; |
838 | 840 | |
839 | 841 | return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC; |
842 | +} | |
843 | + | |
844 | +static inline int rt_bandwidth_enabled(void) | |
845 | +{ | |
846 | + return sysctl_sched_rt_runtime >= 0; | |
840 | 847 | } |
841 | 848 | |
842 | 849 | #ifndef prepare_arch_switch |
kernel/sched_rt.c
... | ... | @@ -386,7 +386,7 @@ |
386 | 386 | int i, idle = 1; |
387 | 387 | cpumask_t span; |
388 | 388 | |
389 | - if (rt_b->rt_runtime == RUNTIME_INF) | |
389 | + if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF) | |
390 | 390 | return 1; |
391 | 391 | |
392 | 392 | span = sched_rt_period_mask(); |
... | ... | @@ -483,6 +483,9 @@ |
483 | 483 | curr->se.sum_exec_runtime += delta_exec; |
484 | 484 | curr->se.exec_start = rq->clock; |
485 | 485 | cpuacct_charge(curr, delta_exec); |
486 | + | |
487 | + if (!rt_bandwidth_enabled()) | |
488 | + return; | |
486 | 489 | |
487 | 490 | for_each_sched_rt_entity(rt_se) { |
488 | 491 | rt_rq = rt_rq_of_se(rt_se); |