Lines Matching refs:rt_b

11 static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun);
68 struct rt_bandwidth *rt_b = in sched_rt_period_timer() local
73 raw_spin_lock(&rt_b->rt_runtime_lock); in sched_rt_period_timer()
75 overrun = hrtimer_forward_now(timer, rt_b->rt_period); in sched_rt_period_timer()
79 raw_spin_unlock(&rt_b->rt_runtime_lock); in sched_rt_period_timer()
80 idle = do_sched_rt_period_timer(rt_b, overrun); in sched_rt_period_timer()
81 raw_spin_lock(&rt_b->rt_runtime_lock); in sched_rt_period_timer()
84 rt_b->rt_period_active = 0; in sched_rt_period_timer()
85 raw_spin_unlock(&rt_b->rt_runtime_lock); in sched_rt_period_timer()
90 void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime) in init_rt_bandwidth() argument
92 rt_b->rt_period = ns_to_ktime(period); in init_rt_bandwidth()
93 rt_b->rt_runtime = runtime; in init_rt_bandwidth()
95 raw_spin_lock_init(&rt_b->rt_runtime_lock); in init_rt_bandwidth()
97 hrtimer_init(&rt_b->rt_period_timer, CLOCK_MONOTONIC, in init_rt_bandwidth()
99 rt_b->rt_period_timer.function = sched_rt_period_timer; in init_rt_bandwidth()
102 static inline void do_start_rt_bandwidth(struct rt_bandwidth *rt_b) in do_start_rt_bandwidth() argument
104 raw_spin_lock(&rt_b->rt_runtime_lock); in do_start_rt_bandwidth()
105 if (!rt_b->rt_period_active) { in do_start_rt_bandwidth()
106 rt_b->rt_period_active = 1; in do_start_rt_bandwidth()
115 hrtimer_forward_now(&rt_b->rt_period_timer, ns_to_ktime(0)); in do_start_rt_bandwidth()
116 hrtimer_start_expires(&rt_b->rt_period_timer, in do_start_rt_bandwidth()
119 raw_spin_unlock(&rt_b->rt_runtime_lock); in do_start_rt_bandwidth()
122 static void start_rt_bandwidth(struct rt_bandwidth *rt_b) in start_rt_bandwidth() argument
124 if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF) in start_rt_bandwidth()
127 do_start_rt_bandwidth(rt_b); in start_rt_bandwidth()
160 static void destroy_rt_bandwidth(struct rt_bandwidth *rt_b) in destroy_rt_bandwidth() argument
162 hrtimer_cancel(&rt_b->rt_period_timer); in destroy_rt_bandwidth()
642 struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu) in sched_rt_period_rt_rq() argument
644 return container_of(rt_b, struct task_group, rt_bandwidth)->rt_rq[cpu]; in sched_rt_period_rt_rq()
704 struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu) in sched_rt_period_rt_rq() argument
718 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in sched_rt_bandwidth_account() local
720 return (hrtimer_active(&rt_b->rt_period_timer) || in sched_rt_bandwidth_account()
721 rt_rq->rt_time < rt_b->rt_runtime); in sched_rt_bandwidth_account()
730 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in do_balance_runtime() local
737 raw_spin_lock(&rt_b->rt_runtime_lock); in do_balance_runtime()
738 rt_period = ktime_to_ns(rt_b->rt_period); in do_balance_runtime()
740 struct rt_rq *iter = sched_rt_period_rt_rq(rt_b, i); in do_balance_runtime()
774 raw_spin_unlock(&rt_b->rt_runtime_lock); in do_balance_runtime()
790 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in __disable_runtime() local
794 raw_spin_lock(&rt_b->rt_runtime_lock); in __disable_runtime()
802 rt_rq->rt_runtime == rt_b->rt_runtime) in __disable_runtime()
811 want = rt_b->rt_runtime - rt_rq->rt_runtime; in __disable_runtime()
817 struct rt_rq *iter = sched_rt_period_rt_rq(rt_b, i); in __disable_runtime()
855 raw_spin_unlock(&rt_b->rt_runtime_lock); in __disable_runtime()
874 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in __enable_runtime() local
876 raw_spin_lock(&rt_b->rt_runtime_lock); in __enable_runtime()
878 rt_rq->rt_runtime = rt_b->rt_runtime; in __enable_runtime()
882 raw_spin_unlock(&rt_b->rt_runtime_lock); in __enable_runtime()
901 static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun) in do_sched_rt_period_timer() argument
917 if (rt_b == &root_task_group.rt_bandwidth) in do_sched_rt_period_timer()
922 struct rt_rq *rt_rq = sched_rt_period_rt_rq(rt_b, i); in do_sched_rt_period_timer()
933 rt_rq->rt_runtime = rt_b->rt_runtime; in do_sched_rt_period_timer()
980 if (!throttled && (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF)) in do_sched_rt_period_timer()
1014 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in sched_rt_runtime_exceeded() local
1020 if (likely(rt_b->rt_runtime)) { in sched_rt_runtime_exceeded()