diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:18:53 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2017-05-26 17:12:35 -0400 |
commit | 7402122d4848083c3c3bc19dafb0d5dea92776fd (patch) | |
tree | b36591de4294e15d32be92d847ca4e4e321f3b9e | |
parent | 2e86bcb945f8e4f1476072fcdd9f0a5b2697cd95 (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.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index f139f22ce30d..ec2cdd9e347f 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 | |||
11 | int sched_rr_timeslice = RR_TIMESLICE; | 13 | int sched_rr_timeslice = RR_TIMESLICE; |
12 | 14 | ||
13 | static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun); | 15 | static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun); |
@@ -509,7 +511,9 @@ static void sched_rt_rq_enqueue(struct rt_rq *rt_rq) | |||
509 | else if (!on_rt_rq(rt_se)) | 511 | else if (!on_rt_rq(rt_se)) |
510 | enqueue_rt_entity(rt_se, 0); | 512 | enqueue_rt_entity(rt_se, 0); |
511 | 513 | ||
512 | if (rt_rq->highest_prio.curr < curr->prio) | 514 | if (rt_rq->highest_prio.curr < curr->prio |
515 | /* Don't subject LITMUS^RT tasks to remote reschedules. */ | ||
516 | && !is_realtime(curr)) | ||
513 | resched_curr(rq); | 517 | resched_curr(rq); |
514 | } | 518 | } |
515 | } | 519 | } |
@@ -596,7 +600,7 @@ static inline void sched_rt_rq_enqueue(struct rt_rq *rt_rq) | |||
596 | { | 600 | { |
597 | struct rq *rq = rq_of_rt_rq(rt_rq); | 601 | struct rq *rq = rq_of_rt_rq(rt_rq); |
598 | 602 | ||
599 | if (!rt_rq->rt_nr_running) | 603 | if (!rt_rq->rt_nr_running || is_realtime(rq_of_rt_rq(rt_rq)->curr)) |
600 | return; | 604 | return; |
601 | 605 | ||
602 | enqueue_top_rt_rq(rt_rq); | 606 | enqueue_top_rt_rq(rt_rq); |