From 150425d2e08f46dd25547d397b70835598dfffe1 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Tue, 12 Apr 2011 17:58:36 -0400 Subject: Moved back to the sporadic task model for BE tasks. --- litmus/sched_edf_hsb.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/litmus/sched_edf_hsb.c b/litmus/sched_edf_hsb.c index cd03cd748c60..7f944d1d97f0 100644 --- a/litmus/sched_edf_hsb.c +++ b/litmus/sched_edf_hsb.c @@ -2125,23 +2125,13 @@ static void edf_hsb_task_new(struct task_struct *task, int on_rq, int running) static void edf_hsb_task_wake_up(struct task_struct *task) { + lt_t now; unsigned long flags; cpu_entry_t *entry = task_sched_entry(task); - TRACE_TASK(task, "wake_up at %llu on %d, %d\n", TIME(litmus_clock()), task_cpu(task), task->rt_param.task_params.cpu); - set_rt_flags(task, RT_F_RUNNING); - - /* The job blocked while it was being run by a slack server */ - if (is_queued(task)) { - check_slack_candidate(task); - return; - } - - //BUG_ON(entry->scheduled == task); - raw_spin_lock_irqsave(global_lock, flags); /* A task set was released. Start servers. */ @@ -2149,10 +2139,32 @@ static void edf_hsb_task_wake_up(struct task_struct *task) start_servers(get_deadline(task) - get_rt_period(task) - get_rt_phase(task)); - /* Note that since we are not re-releasing a task here, we have - * switched from the sporadic to the periodic task model. See - * sched_gsn_edf.c for the sporadic version. - */ + if (!is_be(task)) { + /* Non-BE tasks are not sporadic in this model */ + set_rt_flags(task, RT_F_RUNNING); + + /* The job blocked while it was being run by a slack server */ + if (is_queued(task)) { + check_slack_candidate(task); + raw_spin_unlock_irqrestore(global_lock, flags); + return; + } + } else { + /* Treat BE tasks as sporadic */ + if (get_rt_flags(task) == RT_F_EXIT_SEM) { + set_rt_flags(task, RT_F_RUNNING); + } else { + now = litmus_clock(); + if (is_tardy(task, now)) { + /* New sporadic release */ + release_at(task, now); + sched_trace_task_release(task); + } else if (task->rt.time_slice) { + /* Came back before deadline */ + set_rt_flags(task, RT_F_RUNNING); + } + } + } job_arrival(task, entry); -- cgit v1.2.2