From 16702bd7d7d8e797a4d87834ed861885742cb6c6 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Tue, 21 Sep 2010 20:54:41 -0400 Subject: EDF-WM: rip out non-preemptivity checks --- litmus/sched_edf_wm.c | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/litmus/sched_edf_wm.c b/litmus/sched_edf_wm.c index ed8cc24e9fe6..324ca8f28ab7 100644 --- a/litmus/sched_edf_wm.c +++ b/litmus/sched_edf_wm.c @@ -128,17 +128,9 @@ static void wm_tick(struct task_struct *t) BUG_ON(is_realtime(t) && t != dom->scheduled); if (is_realtime(t) && budget_enforced(t) && budget_exhausted(t)) { - if (!is_np(t)) { - set_tsk_need_resched(t); - TRACE("wm_scheduler_tick: " - "%d is preemptable " - " => FORCE_RESCHED\n", t->pid); - } else if (is_user_np(t)) { - TRACE("wm_scheduler_tick: " - "%d is non-preemptable, " - "preemption delayed.\n", t->pid); - request_exit_np(t); - } + set_tsk_need_resched(t); + TRACE_DOM(dom, "budget of %d exhausted in tick\n", + t->pid); } } @@ -149,7 +141,7 @@ static struct task_struct* wm_schedule(struct task_struct * prev) struct task_struct* next; int out_of_time, sleep, preempt, - np, exists, blocks, resched; + exists, blocks, resched; raw_spin_lock(&dom->slock); @@ -166,7 +158,6 @@ static struct task_struct* wm_schedule(struct task_struct * prev) out_of_time = exists && budget_enforced(dom->scheduled) && budget_exhausted(dom->scheduled); - np = exists && is_np(dom->scheduled); sleep = exists && get_rt_flags(dom->scheduled) == RT_F_SLEEP; preempt = edf_preemption_needed(edf, prev); @@ -181,17 +172,11 @@ static struct task_struct* wm_schedule(struct task_struct * prev) if (blocks) resched = 1; - /* Request a sys_exit_np() call if we would like to preempt but cannot. - * Multiple calls to request_exit_np() don't hurt. - */ - if (np && (out_of_time || preempt || sleep)) - request_exit_np(dom->scheduled); - /* Any task that is preemptable and either exhausts its execution * budget or wants to sleep completes. We may have to reschedule after * this. */ - if (!np && (out_of_time || sleep) && !blocks) { + if ((out_of_time || sleep) && !blocks) { job_completion(dom->scheduled, !sleep); resched = 1; } @@ -201,17 +186,13 @@ static struct task_struct* wm_schedule(struct task_struct * prev) * resched. */ next = NULL; - if ((!np || blocks) && (resched || !exists)) { - /* Take care of a previously scheduled - * job by taking it out of the Linux runqueue. - */ + if (resched || !exists) { if (dom->scheduled && !blocks) requeue(dom->scheduled, edf); next = __take_ready(edf); } else /* Only override Linux scheduler if we have a real-time task - * scheduled that needs to continue. - */ + * scheduled that needs to continue. */ if (exists) next = prev; @@ -269,15 +250,9 @@ static void wm_task_wake_up(struct task_struct *task) TRACE_TASK(task, "wake_up at %llu\n", litmus_clock()); raw_spin_lock_irqsave(&dom->slock, flags); BUG_ON(is_queued(task)); - /* We need to take suspensions because of semaphores into - * account! If a job resumes after being suspended due to acquiring - * a semaphore, it should never be treated as a new job release. - * - * FIXME: This should be done in some more predictable and userspace-controlled way. - */ + now = litmus_clock(); - if (is_tardy(task, now) && - get_rt_flags(task) != RT_F_EXIT_SEM) { + if (is_tardy(task, now)) { /* new sporadic release */ release_at(task, now); sched_trace_task_release(task); -- cgit v1.2.2