diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-09-22 15:55:35 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-09-22 15:55:35 -0400 |
commit | 870eaa144c59ee2665b70dcbb9d8649e99e3c0c4 (patch) | |
tree | 661b6bdedddc5a88278ff46cdea1fd1eb4c3d471 | |
parent | c79c1cc4c5f3b5828366cd1683e4227c12252a98 (diff) |
EDF-WM: migrating tasks can actually be queued when blocking
The migration code patch simulates blocking if state changes occur
while dropping the lock. We need to handle that.
-rw-r--r-- | litmus/sched_edf_wm.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/litmus/sched_edf_wm.c b/litmus/sched_edf_wm.c index f3627ad1174a..44e05948980c 100644 --- a/litmus/sched_edf_wm.c +++ b/litmus/sched_edf_wm.c | |||
@@ -505,14 +505,22 @@ static void wm_task_wake_up(struct task_struct *t) | |||
505 | 505 | ||
506 | static void wm_task_block(struct task_struct *t) | 506 | static void wm_task_block(struct task_struct *t) |
507 | { | 507 | { |
508 | wm_domain_t* dom = domain_of_task(t); | ||
509 | unsigned long flags; | ||
508 | lt_t now = litmus_clock(); | 510 | lt_t now = litmus_clock(); |
509 | /* only running tasks can block, thus t is in no queue */ | 511 | |
510 | TRACE_TASK(t, "block at %llu, state=%d\n", now, t->state); | 512 | TRACE_TASK(t, "block at %llu, state=%d\n", now, t->state); |
511 | 513 | ||
512 | tsk_rt(t)->semi_part.wm.suspend_time = now; | 514 | tsk_rt(t)->semi_part.wm.suspend_time = now; |
513 | 515 | ||
516 | raw_spin_lock_irqsave(&dom->slock, flags); | ||
517 | if (is_queued(t)) { | ||
518 | TRACE_TASK(t, "still queued; migration invariant failed?\n"); | ||
519 | remove(&dom->domain, t); | ||
520 | } | ||
521 | raw_spin_unlock_irqrestore(&dom->slock, flags); | ||
522 | |||
514 | BUG_ON(!is_realtime(t)); | 523 | BUG_ON(!is_realtime(t)); |
515 | BUG_ON(is_queued(t)); | ||
516 | } | 524 | } |
517 | 525 | ||
518 | static void wm_task_exit(struct task_struct * t) | 526 | static void wm_task_exit(struct task_struct * t) |