diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-09-10 04:23:15 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-10-18 16:14:10 -0400 |
commit | f0785d83a7ecdbe7f634fca6e1fd01beb9383e40 (patch) | |
tree | eefcb0acd917d09a7fc817c3e9b739a39300caab | |
parent | 9e6b747ce5c8ae700441d42d84c723832d91ecf8 (diff) |
P-FP: be less permissive about non-running tasks in queue
No suspended task should ever be queued in this plugin.
-rw-r--r-- | litmus/sched_pfp.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c index 2165e1c79df5..829226a56c04 100644 --- a/litmus/sched_pfp.c +++ b/litmus/sched_pfp.c | |||
@@ -112,8 +112,7 @@ static void pfp_domain_init(pfp_domain_t* pfp, | |||
112 | 112 | ||
113 | static void requeue(struct task_struct* t, pfp_domain_t *pfp) | 113 | static void requeue(struct task_struct* t, pfp_domain_t *pfp) |
114 | { | 114 | { |
115 | if (t->state != TASK_RUNNING) | 115 | BUG_ON(!is_running(t)); |
116 | TRACE_TASK(t, "requeue: !TASK_RUNNING\n"); | ||
117 | 116 | ||
118 | set_rt_flags(t, RT_F_RUNNING); | 117 | set_rt_flags(t, RT_F_RUNNING); |
119 | if (is_released(t, litmus_clock())) | 118 | if (is_released(t, litmus_clock())) |
@@ -225,6 +224,21 @@ static struct task_struct* pfp_schedule(struct task_struct * prev) | |||
225 | if (pfp->scheduled && !blocks && !migrate) | 224 | if (pfp->scheduled && !blocks && !migrate) |
226 | requeue(pfp->scheduled, pfp); | 225 | requeue(pfp->scheduled, pfp); |
227 | next = fp_prio_take(&pfp->ready_queue); | 226 | next = fp_prio_take(&pfp->ready_queue); |
227 | if (next == prev) { | ||
228 | struct task_struct *t = fp_prio_peek(&pfp->ready_queue); | ||
229 | TRACE_TASK(next, "next==prev sleep=%d oot=%d np=%d preempt=%d migrate=%d " | ||
230 | "boost=%d empty=%d prio-idx=%u prio=%u\n", | ||
231 | sleep, out_of_time, np, preempt, migrate, | ||
232 | is_priority_boosted(next), | ||
233 | t == NULL, | ||
234 | priority_index(next), | ||
235 | get_priority(next)); | ||
236 | if (t) | ||
237 | TRACE_TASK(t, "waiter boost=%d prio-idx=%u prio=%u\n", | ||
238 | is_priority_boosted(t), | ||
239 | priority_index(t), | ||
240 | get_priority(t)); | ||
241 | } | ||
228 | /* If preempt is set, we should not see the same task again. */ | 242 | /* If preempt is set, we should not see the same task again. */ |
229 | BUG_ON(preempt && next == prev); | 243 | BUG_ON(preempt && next == prev); |
230 | /* Similarly, if preempt is set, then next may not be NULL, | 244 | /* Similarly, if preempt is set, then next may not be NULL, |