Lines Matching refs:rt_b
15 static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun);
21 struct rt_bandwidth *rt_b = in sched_rt_period_timer() local
26 raw_spin_lock(&rt_b->rt_runtime_lock); in sched_rt_period_timer()
28 overrun = hrtimer_forward_now(timer, rt_b->rt_period); in sched_rt_period_timer()
32 raw_spin_unlock(&rt_b->rt_runtime_lock); in sched_rt_period_timer()
33 idle = do_sched_rt_period_timer(rt_b, overrun); in sched_rt_period_timer()
34 raw_spin_lock(&rt_b->rt_runtime_lock); in sched_rt_period_timer()
37 rt_b->rt_period_active = 0; in sched_rt_period_timer()
38 raw_spin_unlock(&rt_b->rt_runtime_lock); in sched_rt_period_timer()
43 void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime) in init_rt_bandwidth() argument
45 rt_b->rt_period = ns_to_ktime(period); in init_rt_bandwidth()
46 rt_b->rt_runtime = runtime; in init_rt_bandwidth()
48 raw_spin_lock_init(&rt_b->rt_runtime_lock); in init_rt_bandwidth()
50 hrtimer_init(&rt_b->rt_period_timer, CLOCK_MONOTONIC, in init_rt_bandwidth()
52 rt_b->rt_period_timer.function = sched_rt_period_timer; in init_rt_bandwidth()
55 static void start_rt_bandwidth(struct rt_bandwidth *rt_b) in start_rt_bandwidth() argument
57 if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF) in start_rt_bandwidth()
60 raw_spin_lock(&rt_b->rt_runtime_lock); in start_rt_bandwidth()
61 if (!rt_b->rt_period_active) { in start_rt_bandwidth()
62 rt_b->rt_period_active = 1; in start_rt_bandwidth()
71 hrtimer_forward_now(&rt_b->rt_period_timer, ns_to_ktime(0)); in start_rt_bandwidth()
72 hrtimer_start_expires(&rt_b->rt_period_timer, in start_rt_bandwidth()
75 raw_spin_unlock(&rt_b->rt_runtime_lock); in start_rt_bandwidth()
108 static void destroy_rt_bandwidth(struct rt_bandwidth *rt_b) in destroy_rt_bandwidth() argument
110 hrtimer_cancel(&rt_b->rt_period_timer); in destroy_rt_bandwidth()
601 struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu) in sched_rt_period_rt_rq() argument
603 return container_of(rt_b, struct task_group, rt_bandwidth)->rt_rq[cpu]; in sched_rt_period_rt_rq()
663 struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu) in sched_rt_period_rt_rq() argument
677 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in sched_rt_bandwidth_account() local
679 return (hrtimer_active(&rt_b->rt_period_timer) || in sched_rt_bandwidth_account()
680 rt_rq->rt_time < rt_b->rt_runtime); in sched_rt_bandwidth_account()
689 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in do_balance_runtime() local
696 raw_spin_lock(&rt_b->rt_runtime_lock); in do_balance_runtime()
697 rt_period = ktime_to_ns(rt_b->rt_period); in do_balance_runtime()
699 struct rt_rq *iter = sched_rt_period_rt_rq(rt_b, i); in do_balance_runtime()
733 raw_spin_unlock(&rt_b->rt_runtime_lock); in do_balance_runtime()
749 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in __disable_runtime() local
753 raw_spin_lock(&rt_b->rt_runtime_lock); in __disable_runtime()
761 rt_rq->rt_runtime == rt_b->rt_runtime) in __disable_runtime()
770 want = rt_b->rt_runtime - rt_rq->rt_runtime; in __disable_runtime()
776 struct rt_rq *iter = sched_rt_period_rt_rq(rt_b, i); in __disable_runtime()
814 raw_spin_unlock(&rt_b->rt_runtime_lock); in __disable_runtime()
833 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in __enable_runtime() local
835 raw_spin_lock(&rt_b->rt_runtime_lock); in __enable_runtime()
837 rt_rq->rt_runtime = rt_b->rt_runtime; in __enable_runtime()
841 raw_spin_unlock(&rt_b->rt_runtime_lock); in __enable_runtime()
860 static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun) in do_sched_rt_period_timer() argument
876 if (rt_b == &root_task_group.rt_bandwidth) in do_sched_rt_period_timer()
881 struct rt_rq *rt_rq = sched_rt_period_rt_rq(rt_b, i); in do_sched_rt_period_timer()
891 rt_rq->rt_runtime = rt_b->rt_runtime; in do_sched_rt_period_timer()
938 if (!throttled && (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF)) in do_sched_rt_period_timer()
972 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); in sched_rt_runtime_exceeded() local
978 if (likely(rt_b->rt_runtime)) { in sched_rt_runtime_exceeded()