]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sched: rt-bandwidth group disable fixes
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Tue, 19 Aug 2008 10:33:04 +0000 (12:33 +0200)
committerIngo Molnar <mingo@elte.hu>
Tue, 19 Aug 2008 11:10:10 +0000 (13:10 +0200)
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>
kernel/sched.c
kernel/sched_rt.c

index 9a1ddb84e26d56e7d6b283daab1edbad20ae2042..c1bee5fb8154758e3590d459b23224ade082948d 100644 (file)
@@ -204,11 +204,13 @@ void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime)
        rt_b->rt_period_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ;
 }
 
+static inline int rt_bandwidth_enabled(void);
+
 static void start_rt_bandwidth(struct rt_bandwidth *rt_b)
 {
        ktime_t now;
 
-       if (rt_b->rt_runtime == RUNTIME_INF)
+       if (rt_bandwidth_enabled() && rt_b->rt_runtime == RUNTIME_INF)
                return;
 
        if (hrtimer_active(&rt_b->rt_period_timer))
@@ -839,6 +841,11 @@ static inline u64 global_rt_runtime(void)
        return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC;
 }
 
+static inline int rt_bandwidth_enabled(void)
+{
+       return sysctl_sched_rt_runtime >= 0;
+}
+
 #ifndef prepare_arch_switch
 # define prepare_arch_switch(next)     do { } while (0)
 #endif
index 77340b04a5380ae6502bccf43e754e0b2cd203e9..94daace5ee151e45303f0eac48e8f9900d13acc3 100644 (file)
@@ -386,7 +386,7 @@ static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun)
        int i, idle = 1;
        cpumask_t span;
 
-       if (rt_b->rt_runtime == RUNTIME_INF)
+       if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF)
                return 1;
 
        span = sched_rt_period_mask();
@@ -484,6 +484,9 @@ static void update_curr_rt(struct rq *rq)
        curr->se.exec_start = rq->clock;
        cpuacct_charge(curr, delta_exec);
 
+       if (!rt_bandwidth_enabled())
+               return;
+
        for_each_sched_rt_entity(rt_se) {
                rt_rq = rt_rq_of_se(rt_se);