aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2008-08-19 06:33:04 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-19 07:10:10 -0400
commit0b148fa04852859972abbf848177b92daeef138a (patch)
tree12d4b0daa8292fe406871b5aa034d7c9b2fae13d /kernel/sched.c
parent6f0d5c390e4206dcb3804a5072a048fdb7d2b428 (diff)
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>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 9a1ddb84e26d..c1bee5fb8154 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -204,11 +204,13 @@ void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime)
204 rt_b->rt_period_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ; 204 rt_b->rt_period_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ;
205} 205}
206 206
207static inline int rt_bandwidth_enabled(void);
208
207static void start_rt_bandwidth(struct rt_bandwidth *rt_b) 209static void start_rt_bandwidth(struct rt_bandwidth *rt_b)
208{ 210{
209 ktime_t now; 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 return; 214 return;
213 215
214 if (hrtimer_active(&rt_b->rt_period_timer)) 216 if (hrtimer_active(&rt_b->rt_period_timer))
@@ -839,6 +841,11 @@ static inline u64 global_rt_runtime(void)
839 return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC; 841 return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC;
840} 842}
841 843
844static inline int rt_bandwidth_enabled(void)
845{
846 return sysctl_sched_rt_runtime >= 0;
847}
848
842#ifndef prepare_arch_switch 849#ifndef prepare_arch_switch
843# define prepare_arch_switch(next) do { } while (0) 850# define prepare_arch_switch(next) do { } while (0)
844#endif 851#endif