diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-10 12:10:49 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-11 17:57:44 -0500 |
commit | fb3df2ec261d8cd6bcb8206d9d985355214d7767 (patch) | |
tree | c41f8818ad4f1b699afbe292d131c1073b4d7c6e /litmus/sched_cedf.c | |
parent | 516b6601bb5f71035e8859735a25dea0da4a0211 (diff) |
Implement proper remote preemption support
To date, Litmus has just hooked into the smp_send_reschedule() IPI
handler and marked tasks as having to reschedule to implement remote
preemptions. This was never particularly clean, but so far we got away
with it. However, changes in the underlying Linux, and peculartities
of the ARM code (interrupts enabled before context switch) break this
naive approach. This patch introduces new state-machine based remote
preemption support. By examining the local state before calling
set_tsk_need_resched(), we avoid confusing the underlying Linux
scheduler. Further, this patch avoids sending unncessary IPIs.
Diffstat (limited to 'litmus/sched_cedf.c')
-rw-r--r-- | litmus/sched_cedf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c index a729d97535e9..615560f21d60 100644 --- a/litmus/sched_cedf.c +++ b/litmus/sched_cedf.c | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #include <litmus/litmus.h> | 35 | #include <litmus/litmus.h> |
36 | #include <litmus/jobs.h> | 36 | #include <litmus/jobs.h> |
37 | #include <litmus/preempt.h> | ||
37 | #include <litmus/sched_plugin.h> | 38 | #include <litmus/sched_plugin.h> |
38 | #include <litmus/edf_common.h> | 39 | #include <litmus/edf_common.h> |
39 | #include <litmus/sched_trace.h> | 40 | #include <litmus/sched_trace.h> |
@@ -341,7 +342,7 @@ static void cedf_tick(struct task_struct* t) | |||
341 | /* np tasks will be preempted when they become | 342 | /* np tasks will be preempted when they become |
342 | * preemptable again | 343 | * preemptable again |
343 | */ | 344 | */ |
344 | set_tsk_need_resched(t); | 345 | litmus_reschedule_local(); |
345 | set_will_schedule(); | 346 | set_will_schedule(); |
346 | TRACE("cedf_scheduler_tick: " | 347 | TRACE("cedf_scheduler_tick: " |
347 | "%d is preemptable " | 348 | "%d is preemptable " |
@@ -466,6 +467,7 @@ static struct task_struct* cedf_schedule(struct task_struct * prev) | |||
466 | if (exists) | 467 | if (exists) |
467 | next = prev; | 468 | next = prev; |
468 | 469 | ||
470 | sched_state_task_picked(); | ||
469 | raw_spin_unlock(&cluster->lock); | 471 | raw_spin_unlock(&cluster->lock); |
470 | 472 | ||
471 | #ifdef WANT_ALL_SCHED_EVENTS | 473 | #ifdef WANT_ALL_SCHED_EVENTS |