From 1288313c31e75a5138e4c87901eda10a07ee80ca Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Mon, 1 Jul 2013 23:56:31 +0200 Subject: Hook into rt scheduling class to protect LITMUS^RT tasks The rt scheduling class thinks it's the highest-priority scheduling class around. It is not in LITMUS^RT. Don't go preempting remote cores that run SCHED_LITMUS tasks. --- kernel/sched/rt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 127a2c4cf4ab..d0e3cac644b4 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -7,6 +7,8 @@ #include +#include + int sched_rr_timeslice = RR_TIMESLICE; static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun); @@ -436,7 +438,9 @@ static void sched_rt_rq_enqueue(struct rt_rq *rt_rq) if (rt_rq->rt_nr_running) { if (rt_se && !on_rt_rq(rt_se)) enqueue_rt_entity(rt_se, false); - if (rt_rq->highest_prio.curr < curr->prio) + if (rt_rq->highest_prio.curr < curr->prio + /* Don't subject LITMUS^RT tasks to remote reschedules. */ + && !is_realtime(curr)) resched_task(curr); } } @@ -530,7 +534,8 @@ static inline struct rt_rq *group_rt_rq(struct sched_rt_entity *rt_se) static inline void sched_rt_rq_enqueue(struct rt_rq *rt_rq) { - if (rt_rq->rt_nr_running) + if (rt_rq->rt_nr_running + && !is_realtime(rq_of_rt_rq(rt_rq)->curr)) resched_task(rq_of_rt_rq(rt_rq)->curr); } -- cgit v1.2.2