aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2007-05-14 16:17:26 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2007-05-14 16:17:26 -0400
commit4ced58555b1650970dde6ef4325af134418f885e (patch)
tree25bed0d022548bd6c9b23999b453057862fde5be /kernel
parent1bd5e0b8bca4601c95f44d39813a535a8e0eb437 (diff)
Fix GSN-EDF sleep_next_period
The standard EDF implementation does not work for GSN-EDF since it does not perform the task preparation in schedule().
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched_gsn_edf.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/kernel/sched_gsn_edf.c b/kernel/sched_gsn_edf.c
index 046fe41e09..10d3908442 100644
--- a/kernel/sched_gsn_edf.c
+++ b/kernel/sched_gsn_edf.c
@@ -666,6 +666,28 @@ static long gsnedf_return_priority(struct pi_semaphore *sem)
666 return ret; 666 return ret;
667} 667}
668 668
669/*
670 * Deactivate current task until the beginning of the next period.
671 */
672static long gsnedf_sleep_next_period(void)
673{
674 /* Mark that we do not excute anymore */
675 set_rt_flags(t, RT_F_SLEEP);
676 sched_trace_job_completion(t);
677 /* prepare for next period */
678 prepare_for_next_period(t);
679
680 /* unlink */
681 unlink(t);
682 /* requeue */
683 gsnedf_job_arrival(t);
684
685 /* will reschedule on return to user mode */
686 set_tsk_need_resched(t);
687 return 0;
688}
689
690
669static int gsnedf_mode_change(int new_mode) 691static int gsnedf_mode_change(int new_mode)
670{ 692{
671 unsigned long flags; 693 unsigned long flags;
@@ -713,7 +735,7 @@ static sched_plugin_t s_plugin __cacheline_aligned_in_smp = {
713 .algo_scheduler_tick = gsnedf_scheduler_tick, \ 735 .algo_scheduler_tick = gsnedf_scheduler_tick, \
714 .scheduler_tick = rt_scheduler_tick, \ 736 .scheduler_tick = rt_scheduler_tick, \
715 .prepare_task = gsnedf_prepare_task, \ 737 .prepare_task = gsnedf_prepare_task, \
716 .sleep_next_period = edf_sleep_next_period, \ 738 .sleep_next_period = gsnedf_sleep_next_period, \
717 .tear_down = gsnedf_tear_down, \ 739 .tear_down = gsnedf_tear_down, \
718 .schedule = gsnedf_schedule, \ 740 .schedule = gsnedf_schedule, \
719 .finish_switch = gsnedf_finish_switch, \ 741 .finish_switch = gsnedf_finish_switch, \