diff options
Diffstat (limited to 'kernel/sched/deadline.c')
-rw-r--r-- | kernel/sched/deadline.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index a8a08030a8f7..1842c3e33476 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include "sched.h" | 18 | #include "sched.h" |
19 | #include "pelt.h" | 19 | #include "pelt.h" |
20 | 20 | ||
21 | #include <litmus/litmus.h> | ||
22 | |||
21 | struct dl_bandwidth def_dl_bandwidth; | 23 | struct dl_bandwidth def_dl_bandwidth; |
22 | 24 | ||
23 | static inline struct task_struct *dl_task_of(struct sched_dl_entity *dl_se) | 25 | static inline struct task_struct *dl_task_of(struct sched_dl_entity *dl_se) |
@@ -1049,17 +1051,21 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) | |||
1049 | #endif | 1051 | #endif |
1050 | 1052 | ||
1051 | enqueue_task_dl(rq, p, ENQUEUE_REPLENISH); | 1053 | enqueue_task_dl(rq, p, ENQUEUE_REPLENISH); |
1052 | if (dl_task(rq->curr)) | 1054 | if (dl_task(rq->curr)) { |
1053 | check_preempt_curr_dl(rq, p, 0); | 1055 | check_preempt_curr_dl(rq, p, 0); |
1054 | else | 1056 | } else if (!is_realtime(rq->curr)) { |
1055 | resched_curr(rq); | 1057 | resched_curr(rq); |
1058 | } | ||
1056 | 1059 | ||
1057 | #ifdef CONFIG_SMP | 1060 | #ifdef CONFIG_SMP |
1058 | /* | 1061 | /* |
1059 | * Queueing this task back might have overloaded rq, check if we need | 1062 | * Queueing this task back might have overloaded rq, check if we need |
1060 | * to kick someone away. | 1063 | * to kick someone away. |
1064 | * | ||
1065 | * LITMUS note: Don't incur this overhead if we are running a LITMUS | ||
1066 | * task. | ||
1061 | */ | 1067 | */ |
1062 | if (has_pushable_dl_tasks(rq)) { | 1068 | if (has_pushable_dl_tasks(rq) && (!is_realtime(rq->curr))) { |
1063 | /* | 1069 | /* |
1064 | * Nothing relies on rq->lock after this, so its safe to drop | 1070 | * Nothing relies on rq->lock after this, so its safe to drop |
1065 | * rq->lock. | 1071 | * rq->lock. |
@@ -2357,9 +2363,13 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p) | |||
2357 | * Since this might be the only -deadline task on the rq, | 2363 | * Since this might be the only -deadline task on the rq, |
2358 | * this is the right place to try to pull some other one | 2364 | * this is the right place to try to pull some other one |
2359 | * from an overloaded CPU, if any. | 2365 | * from an overloaded CPU, if any. |
2366 | * | ||
2367 | * LITMUS note: also don't pull a task when we're running LITMUS tasks. | ||
2360 | */ | 2368 | */ |
2361 | if (!task_on_rq_queued(p) || rq->dl.dl_nr_running) | 2369 | if (!task_on_rq_queued(p) || rq->dl.dl_nr_running || |
2370 | is_realtime(rq->curr)) { | ||
2362 | return; | 2371 | return; |
2372 | } | ||
2363 | 2373 | ||
2364 | deadline_queue_pull_task(rq); | 2374 | deadline_queue_pull_task(rq); |
2365 | } | 2375 | } |
@@ -2374,9 +2384,8 @@ static void switched_to_dl(struct rq *rq, struct task_struct *p) | |||
2374 | put_task_struct(p); | 2384 | put_task_struct(p); |
2375 | 2385 | ||
2376 | /* If p is not queued we will update its parameters at next wakeup. */ | 2386 | /* If p is not queued we will update its parameters at next wakeup. */ |
2377 | if (!task_on_rq_queued(p)) { | 2387 | if (!task_on_rq_queued(p) || is_realtime(rq->curr)) { |
2378 | add_rq_bw(&p->dl, &rq->dl); | 2388 | add_rq_bw(&p->dl, &rq->dl); |
2379 | |||
2380 | return; | 2389 | return; |
2381 | } | 2390 | } |
2382 | 2391 | ||