diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:18:54 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:20:32 -0400 |
commit | c14af815369241598308018ddec195605c058839 (patch) | |
tree | cb61d178700be7de9e62bf3e44cf102d320f0db8 | |
parent | ef95740a215d0db21f08a6c22028f0fb0a7a62fa (diff) |
Hook into SCHED_DEADLINE to protect LITMUS^RT tasks
SCHED_DEADLINE should not preempt LITMUS^RT tasks, as the LITMUS^RT
scheduling class is positioned above the SCHED_DEADLINE policy.
-rw-r--r-- | kernel/sched/deadline.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 5e95145088fd..089331a5236b 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c | |||
@@ -16,6 +16,8 @@ | |||
16 | */ | 16 | */ |
17 | #include "sched.h" | 17 | #include "sched.h" |
18 | 18 | ||
19 | #include <litmus/litmus.h> | ||
20 | |||
19 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
20 | 22 | ||
21 | struct dl_bandwidth def_dl_bandwidth; | 23 | struct dl_bandwidth def_dl_bandwidth; |
@@ -615,14 +617,14 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) | |||
615 | enqueue_task_dl(rq, p, ENQUEUE_REPLENISH); | 617 | enqueue_task_dl(rq, p, ENQUEUE_REPLENISH); |
616 | if (dl_task(rq->curr)) | 618 | if (dl_task(rq->curr)) |
617 | check_preempt_curr_dl(rq, p, 0); | 619 | check_preempt_curr_dl(rq, p, 0); |
618 | else | 620 | else if (!is_realtime(rq->curr)) |
619 | resched_curr(rq); | 621 | resched_curr(rq); |
620 | #ifdef CONFIG_SMP | 622 | #ifdef CONFIG_SMP |
621 | /* | 623 | /* |
622 | * Queueing this task back might have overloaded rq, | 624 | * Queueing this task back might have overloaded rq, |
623 | * check if we need to kick someone away. | 625 | * check if we need to kick someone away. |
624 | */ | 626 | */ |
625 | if (has_pushable_dl_tasks(rq)) | 627 | if (has_pushable_dl_tasks(rq) && is_realtime(rq->curr)) |
626 | push_dl_task(rq); | 628 | push_dl_task(rq); |
627 | #endif | 629 | #endif |
628 | unlock: | 630 | unlock: |
@@ -1710,7 +1712,7 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p) | |||
1710 | if (!task_on_rq_queued(p) || rq->dl.dl_nr_running) | 1712 | if (!task_on_rq_queued(p) || rq->dl.dl_nr_running) |
1711 | return; | 1713 | return; |
1712 | 1714 | ||
1713 | if (pull_dl_task(rq)) | 1715 | if (pull_dl_task(rq) && !is_realtime(rq->curr)) |
1714 | resched_curr(rq); | 1716 | resched_curr(rq); |
1715 | } | 1717 | } |
1716 | 1718 | ||
@@ -1722,7 +1724,7 @@ static void switched_to_dl(struct rq *rq, struct task_struct *p) | |||
1722 | { | 1724 | { |
1723 | int check_resched = 1; | 1725 | int check_resched = 1; |
1724 | 1726 | ||
1725 | if (task_on_rq_queued(p) && rq->curr != p) { | 1727 | if (task_on_rq_queued(p) && rq->curr != p && !is_realtime(rq->curr)) { |
1726 | #ifdef CONFIG_SMP | 1728 | #ifdef CONFIG_SMP |
1727 | if (p->nr_cpus_allowed > 1 && rq->dl.overloaded && | 1729 | if (p->nr_cpus_allowed > 1 && rq->dl.overloaded && |
1728 | push_dl_task(rq) && rq != task_rq(p)) | 1730 | push_dl_task(rq) && rq != task_rq(p)) |