diff options
| author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-05-14 23:41:51 -0400 |
|---|---|---|
| committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-05-14 23:41:51 -0400 |
| commit | 6be1f0e38bf6aa009ca15d593331b672387be589 (patch) | |
| tree | 70e2a9123fb3e259661c7801bfb67576cc8baa4b | |
| parent | aed8838b6d65f3ab614f2971347fd9ba2d302f15 (diff) | |
Support waking up blocked tasks
edfsc_task_wake_up() is called when a task becomes unblocked. Since
we remove blocked tasks from the system in edfsc_gschedule(), this
must be implemented or the previously blocked task will be lost
forever.
| -rw-r--r-- | litmus/sched_edfsc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/litmus/sched_edfsc.c b/litmus/sched_edfsc.c index 8a1cd8f1c85f..212aa8ed0394 100644 --- a/litmus/sched_edfsc.c +++ b/litmus/sched_edfsc.c | |||
| @@ -1071,9 +1071,21 @@ static void edfsc_task_new(struct task_struct* t, int on_rq, int is_scheduled) | |||
| 1071 | TRACE("EDF-sc: task new %d\n", t->pid); | 1071 | TRACE("EDF-sc: task new %d\n", t->pid); |
| 1072 | } | 1072 | } |
| 1073 | 1073 | ||
| 1074 | /** | ||
| 1075 | * This is called by LITMUS when our task is being woken up after having | ||
| 1076 | * previously blocked on something like console or disk I/O. This is a pair to | ||
| 1077 | * the `if (blocks) unlink(entry->scheduled);` in edfsc_gschedule(). | ||
| 1078 | */ | ||
| 1074 | static void edfsc_task_wake_up(struct task_struct *task) | 1079 | static void edfsc_task_wake_up(struct task_struct *task) |
| 1075 | { | 1080 | { |
| 1076 | // TODO | 1081 | unsigned long flags; |
| 1082 | |||
| 1083 | TRACE_TASK(task, "wake_up at %llu\n", litmus_clock()); | ||
| 1084 | raw_spin_lock_irqsave(&g_lock, flags); | ||
| 1085 | // TODO: Look into handling sporadic tasks as sched_gsnedf.c does | ||
| 1086 | requeue(task); | ||
| 1087 | // TODO: Look into queuing preemption as sched_gsnedf.c does? | ||
| 1088 | raw_spin_unlock_irqrestore(&g_lock, flags); | ||
| 1077 | } | 1089 | } |
| 1078 | 1090 | ||
| 1079 | static void edfsc_task_block(struct task_struct *t) | 1091 | static void edfsc_task_block(struct task_struct *t) |
