aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/rt.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 1e4992eb5166..6892ed7d644b 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1045,12 +1045,23 @@ void dec_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) {}
1045#endif /* CONFIG_RT_GROUP_SCHED */ 1045#endif /* CONFIG_RT_GROUP_SCHED */
1046 1046
1047static inline 1047static inline
1048unsigned int rt_se_nr_running(struct sched_rt_entity *rt_se)
1049{
1050 struct rt_rq *group_rq = group_rt_rq(rt_se);
1051
1052 if (group_rq)
1053 return group_rq->rt_nr_running;
1054 else
1055 return 1;
1056}
1057
1058static inline
1048void inc_rt_tasks(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) 1059void inc_rt_tasks(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
1049{ 1060{
1050 int prio = rt_se_prio(rt_se); 1061 int prio = rt_se_prio(rt_se);
1051 1062
1052 WARN_ON(!rt_prio(prio)); 1063 WARN_ON(!rt_prio(prio));
1053 rt_rq->rt_nr_running++; 1064 rt_rq->rt_nr_running += rt_se_nr_running(rt_se);
1054 1065
1055 inc_rt_prio(rt_rq, prio); 1066 inc_rt_prio(rt_rq, prio);
1056 inc_rt_migration(rt_se, rt_rq); 1067 inc_rt_migration(rt_se, rt_rq);
@@ -1062,7 +1073,7 @@ void dec_rt_tasks(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
1062{ 1073{
1063 WARN_ON(!rt_prio(rt_se_prio(rt_se))); 1074 WARN_ON(!rt_prio(rt_se_prio(rt_se)));
1064 WARN_ON(!rt_rq->rt_nr_running); 1075 WARN_ON(!rt_rq->rt_nr_running);
1065 rt_rq->rt_nr_running--; 1076 rt_rq->rt_nr_running -= rt_se_nr_running(rt_se);
1066 1077
1067 dec_rt_prio(rt_rq, rt_se_prio(rt_se)); 1078 dec_rt_prio(rt_rq, rt_se_prio(rt_se));
1068 dec_rt_migration(rt_se, rt_rq); 1079 dec_rt_migration(rt_se, rt_rq);