aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:18:53 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:20:31 -0400
commitef95740a215d0db21f08a6c22028f0fb0a7a62fa (patch)
tree63089146f696ae5ce26ecb216c8218123c45954c
parenta00f41be3fa1bf6cf82e6becfb1873ad83a513d3 (diff)
Hook into rt scheduling class to protect LITMUS^RT tasks
The rt scheduling class thinks it's the highest-priority scheduling class around, next to SCHED_DEADLINE. It is not in LITMUS^RT. Don't go preempting remote cores that run SCHED_LITMUS tasks.
-rw-r--r--kernel/sched/rt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 575da76a3874..613574c71a68 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -8,6 +8,8 @@
8#include <linux/slab.h> 8#include <linux/slab.h>
9#include <linux/irq_work.h> 9#include <linux/irq_work.h>
10 10
11#include <litmus/litmus.h>
12
11int sched_rr_timeslice = RR_TIMESLICE; 13int sched_rr_timeslice = RR_TIMESLICE;
12 14
13static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun); 15static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun);
@@ -487,8 +489,9 @@ static void sched_rt_rq_enqueue(struct rt_rq *rt_rq)
487 enqueue_top_rt_rq(rt_rq); 489 enqueue_top_rt_rq(rt_rq);
488 else if (!on_rt_rq(rt_se)) 490 else if (!on_rt_rq(rt_se))
489 enqueue_rt_entity(rt_se, false); 491 enqueue_rt_entity(rt_se, false);
490 492 if (rt_rq->highest_prio.curr < curr->prio
491 if (rt_rq->highest_prio.curr < curr->prio) 493 /* Don't subject LITMUS^RT tasks to remote reschedules. */
494 && !is_realtime(curr))
492 resched_curr(rq); 495 resched_curr(rq);
493 } 496 }
494} 497}
@@ -575,7 +578,7 @@ static inline void sched_rt_rq_enqueue(struct rt_rq *rt_rq)
575{ 578{
576 struct rq *rq = rq_of_rt_rq(rt_rq); 579 struct rq *rq = rq_of_rt_rq(rt_rq);
577 580
578 if (!rt_rq->rt_nr_running) 581 if (!rt_rq->rt_nr_running || is_realtime(rq_of_rt_rq(rt_rq)->curr))
579 return; 582 return;
580 583
581 enqueue_top_rt_rq(rt_rq); 584 enqueue_top_rt_rq(rt_rq);