diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-02-03 19:56:21 -0500 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-29 17:26:27 -0400 |
commit | 9039e5f731ca5f9a0c69f8523ccfee044111d2e3 (patch) | |
tree | e4f10bbda2a85cfe96e5d8975953bc4bd5b1c981 /litmus/sched_gsn_edf.c | |
parent | f3a6cb9af5cdb01f29ad32b01aa56a14f0da144e (diff) |
Use generic preemption function in GSN- and PSN-EDF.
This patch updates non-preemptive section support in
GSN- and PSN-EDF.
Diffstat (limited to 'litmus/sched_gsn_edf.c')
-rw-r--r-- | litmus/sched_gsn_edf.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index 2a0ee50d26a2..b9310dd6f75c 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -242,27 +242,9 @@ static noinline void unlink(struct task_struct* t) | |||
242 | 242 | ||
243 | /* preempt - force a CPU to reschedule | 243 | /* preempt - force a CPU to reschedule |
244 | */ | 244 | */ |
245 | static noinline void preempt(cpu_entry_t *entry) | 245 | static void preempt(cpu_entry_t *entry) |
246 | { | 246 | { |
247 | /* We cannot make the is_np() decision here if it is a remote CPU | 247 | preempt_if_preemptable(entry->scheduled, entry->cpu); |
248 | * because requesting exit_np() requires that we currently use the | ||
249 | * address space of the task. Thus, in the remote case we just send | ||
250 | * the IPI and let schedule() handle the problem. | ||
251 | */ | ||
252 | |||
253 | if (smp_processor_id() == entry->cpu) { | ||
254 | if (entry->scheduled && is_np(entry->scheduled)) | ||
255 | request_exit_np(entry->scheduled); | ||
256 | else | ||
257 | set_tsk_need_resched(current); | ||
258 | } else | ||
259 | /* in case that it is a remote CPU we have to defer the | ||
260 | * the decision to the remote CPU | ||
261 | * FIXME: We could save a few IPI's here if we leave the flag | ||
262 | * set when we are waiting for a np_exit(). | ||
263 | */ | ||
264 | if (!test_will_schedule(entry->cpu)) | ||
265 | smp_send_reschedule(entry->cpu); | ||
266 | } | 248 | } |
267 | 249 | ||
268 | /* requeue - Put an unlinked task into gsn-edf domain. | 250 | /* requeue - Put an unlinked task into gsn-edf domain. |
@@ -364,7 +346,7 @@ static void gsnedf_tick(struct task_struct* t) | |||
364 | TRACE("gsnedf_scheduler_tick: " | 346 | TRACE("gsnedf_scheduler_tick: " |
365 | "%d is preemptable " | 347 | "%d is preemptable " |
366 | " => FORCE_RESCHED\n", t->pid); | 348 | " => FORCE_RESCHED\n", t->pid); |
367 | } else { | 349 | } else if (is_user_np(t)) { |
368 | TRACE("gsnedf_scheduler_tick: " | 350 | TRACE("gsnedf_scheduler_tick: " |
369 | "%d is non-preemptable, " | 351 | "%d is non-preemptable, " |
370 | "preemption delayed.\n", t->pid); | 352 | "preemption delayed.\n", t->pid); |