diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-12-01 14:44:37 -0500 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-12-21 07:37:14 -0500 |
| commit | c158b5fbe42dacd34393082b6b8f9f6573ab8c5c (patch) | |
| tree | 6d17832776e7ded179c03d2e66135950801753f9 | |
| parent | 31477ed8ca65bb0a3ed3de4cb6df841e6a785471 (diff) | |
Protect SCHED_LITMUS tasks from reschedules triggered by SCHED_FIFO enqueues.2012.3
(BB: edited to include <litmus/litmus.h> to resolve compile error.)
| -rw-r--r-- | kernel/sched_rt.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 58cf5d18dfdc..db04161fe37c 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | * policies) | 3 | * policies) |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #include <litmus/litmus.h> | ||
| 7 | |||
| 6 | #ifdef CONFIG_RT_GROUP_SCHED | 8 | #ifdef CONFIG_RT_GROUP_SCHED |
| 7 | 9 | ||
| 8 | #define rt_entity_is_task(rt_se) (!(rt_se)->my_q) | 10 | #define rt_entity_is_task(rt_se) (!(rt_se)->my_q) |
| @@ -228,8 +230,11 @@ static void sched_rt_rq_enqueue(struct rt_rq *rt_rq) | |||
| 228 | if (rt_rq->rt_nr_running) { | 230 | if (rt_rq->rt_nr_running) { |
| 229 | if (rt_se && !on_rt_rq(rt_se)) | 231 | if (rt_se && !on_rt_rq(rt_se)) |
| 230 | enqueue_rt_entity(rt_se, false); | 232 | enqueue_rt_entity(rt_se, false); |
| 231 | if (rt_rq->highest_prio.curr < curr->prio) | 233 | if (rt_rq->highest_prio.curr < curr->prio && |
| 234 | /* Don't subject LITMUS tasks to remote reschedules */ | ||
| 235 | !is_realtime(curr)) { | ||
| 232 | resched_task(curr); | 236 | resched_task(curr); |
| 237 | } | ||
| 233 | } | 238 | } |
| 234 | } | 239 | } |
| 235 | 240 | ||
| @@ -322,8 +327,10 @@ static inline struct rt_rq *group_rt_rq(struct sched_rt_entity *rt_se) | |||
| 322 | 327 | ||
| 323 | static inline void sched_rt_rq_enqueue(struct rt_rq *rt_rq) | 328 | static inline void sched_rt_rq_enqueue(struct rt_rq *rt_rq) |
| 324 | { | 329 | { |
| 325 | if (rt_rq->rt_nr_running) | 330 | struct task_struct *curr = rq_of_rt_rq(rt_rq)->curr; |
| 326 | resched_task(rq_of_rt_rq(rt_rq)->curr); | 331 | |
| 332 | if (rt_rq->rt_nr_running && !is_realtime(curr)) | ||
| 333 | resched_task(curr); | ||
| 327 | } | 334 | } |
| 328 | 335 | ||
| 329 | static inline void sched_rt_rq_dequeue(struct rt_rq *rt_rq) | 336 | static inline void sched_rt_rq_dequeue(struct rt_rq *rt_rq) |
