Lines Matching defs:rt_se
8 #define rt_entity_is_task(rt_se) (!(rt_se)->my_q)
10 static inline struct task_struct *rt_task_of(struct sched_rt_entity *rt_se)
13 WARN_ON_ONCE(!rt_entity_is_task(rt_se));
15 return container_of(rt_se, struct task_struct, rt);
23 static inline struct rt_rq *rt_rq_of_se(struct sched_rt_entity *rt_se)
25 return rt_se->rt_rq;
30 #define rt_entity_is_task(rt_se) (1)
32 static inline struct task_struct *rt_task_of(struct sched_rt_entity *rt_se)
34 return container_of(rt_se, struct task_struct, rt);
42 static inline struct rt_rq *rt_rq_of_se(struct sched_rt_entity *rt_se)
44 struct task_struct *p = rt_task_of(rt_se);
99 static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
101 if (!rt_entity_is_task(rt_se))
107 if (rt_se->nr_cpus_allowed > 1)
113 static void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
115 if (!rt_entity_is_task(rt_se))
121 if (rt_se->nr_cpus_allowed > 1)
155 void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
160 void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
166 static inline int on_rt_rq(struct sched_rt_entity *rt_se)
168 return !list_empty(&rt_se->run_list);
189 #define for_each_sched_rt_entity(rt_se) \
190 for (; rt_se; rt_se = rt_se->parent)
192 static inline struct rt_rq *group_rt_rq(struct sched_rt_entity *rt_se)
194 return rt_se->my_q;
197 static void enqueue_rt_entity(struct sched_rt_entity *rt_se, bool head);
198 static void dequeue_rt_entity(struct sched_rt_entity *rt_se);
204 struct sched_rt_entity *rt_se;
206 rt_se = rt_rq->tg->rt_se[this_cpu];
209 if (rt_se && !on_rt_rq(rt_se))
210 enqueue_rt_entity(rt_se, false);
219 struct sched_rt_entity *rt_se;
221 rt_se = rt_rq->tg->rt_se[this_cpu];
223 if (rt_se && on_rt_rq(rt_se))
224 dequeue_rt_entity(rt_se);
232 static int rt_se_boosted(struct sched_rt_entity *rt_se)
234 struct rt_rq *rt_rq = group_rt_rq(rt_se);
240 p = rt_task_of(rt_se);
282 #define for_each_sched_rt_entity(rt_se) \
283 for (; rt_se; rt_se = NULL)
285 static inline struct rt_rq *group_rt_rq(struct sched_rt_entity *rt_se)
560 static inline int rt_se_prio(struct sched_rt_entity *rt_se)
563 struct rt_rq *rt_rq = group_rt_rq(rt_se);
569 return rt_task_of(rt_se)->prio;
605 struct sched_rt_entity *rt_se = &curr->rt;
606 struct rt_rq *rt_rq = rt_rq_of_se(rt_se);
629 for_each_sched_rt_entity(rt_se) {
630 rt_rq = rt_rq_of_se(rt_se);
756 inc_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
758 if (rt_se_boosted(rt_se))
766 dec_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
768 if (rt_se_boosted(rt_se))
777 inc_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
783 void dec_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) {}
788 void inc_rt_tasks(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
790 int prio = rt_se_prio(rt_se);
796 inc_rt_migration(rt_se, rt_rq);
797 inc_rt_group(rt_se, rt_rq);
801 void dec_rt_tasks(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
803 WARN_ON(!rt_prio(rt_se_prio(rt_se)));
807 dec_rt_prio(rt_rq, rt_se_prio(rt_se));
808 dec_rt_migration(rt_se, rt_rq);
809 dec_rt_group(rt_se, rt_rq);
812 static void __enqueue_rt_entity(struct sched_rt_entity *rt_se, bool head)
814 struct rt_rq *rt_rq = rt_rq_of_se(rt_se);
816 struct rt_rq *group_rq = group_rt_rq(rt_se);
817 struct list_head *queue = array->queue + rt_se_prio(rt_se);
829 list_add(&rt_se->run_list, queue);
831 list_add_tail(&rt_se->run_list, queue);
832 __set_bit(rt_se_prio(rt_se), array->bitmap);
834 inc_rt_tasks(rt_se, rt_rq);
837 static void __dequeue_rt_entity(struct sched_rt_entity *rt_se)
839 struct rt_rq *rt_rq = rt_rq_of_se(rt_se);
842 list_del_init(&rt_se->run_list);
843 if (list_empty(array->queue + rt_se_prio(rt_se)))
844 __clear_bit(rt_se_prio(rt_se), array->bitmap);
846 dec_rt_tasks(rt_se, rt_rq);
853 static void dequeue_rt_stack(struct sched_rt_entity *rt_se)
857 for_each_sched_rt_entity(rt_se) {
858 rt_se->back = back;
859 back = rt_se;
862 for (rt_se = back; rt_se; rt_se = rt_se->back) {
863 if (on_rt_rq(rt_se))
864 __dequeue_rt_entity(rt_se);
868 static void enqueue_rt_entity(struct sched_rt_entity *rt_se, bool head)
870 dequeue_rt_stack(rt_se);
871 for_each_sched_rt_entity(rt_se)
872 __enqueue_rt_entity(rt_se, head);
875 static void dequeue_rt_entity(struct sched_rt_entity *rt_se)
877 dequeue_rt_stack(rt_se);
879 for_each_sched_rt_entity(rt_se) {
880 struct rt_rq *rt_rq = group_rt_rq(rt_se);
883 __enqueue_rt_entity(rt_se, false);
893 struct sched_rt_entity *rt_se = &p->rt;
896 rt_se->timeout = 0;
898 enqueue_rt_entity(rt_se, flags & ENQUEUE_HEAD);
906 struct sched_rt_entity *rt_se = &p->rt;
909 dequeue_rt_entity(rt_se);
919 requeue_rt_entity(struct rt_rq *rt_rq, struct sched_rt_entity *rt_se, int head)
921 if (on_rt_rq(rt_se)) {
923 struct list_head *queue = array->queue + rt_se_prio(rt_se);
926 list_move(&rt_se->run_list, queue);
928 list_move_tail(&rt_se->run_list, queue);
934 struct sched_rt_entity *rt_se = &p->rt;
937 for_each_sched_rt_entity(rt_se) {
938 rt_rq = rt_rq_of_se(rt_se);
939 requeue_rt_entity(rt_rq, rt_se, head);
1058 struct sched_rt_entity *rt_se;
1071 rt_se = pick_next_rt_entity(rq, rt_rq);
1072 BUG_ON(!rt_se);
1073 rt_rq = group_rt_rq(rt_se);
1076 p = rt_task_of(rt_se);
1134 struct sched_rt_entity *rt_se;
1147 list_for_each_entry(rt_se, array->queue + idx, run_list) {
1150 if (!rt_entity_is_task(rt_se))
1153 p = rt_task_of(rt_se);