diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-21 18:43:43 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-21 18:47:18 -0400 |
commit | 7bbf3205ae1979cb41fd2a0dfdd103656bf8e84e (patch) | |
tree | b7ffd5eacbd6f11c42ec1e4cee0bc2041bcabd79 /litmus/sched_psn_edf.c | |
parent | 469aaad39c956446b8a31d351ee36bedd87ac18a (diff) |
SOBLIV draining support for C-EDF.wip-2012.3-gpu
Adds support for suspension-oblivous budget draining
to C-EDF. Also changes how jobs with exhausted budget
in C-EDF are treated: jobs are early released until
they catch up.
Diffstat (limited to 'litmus/sched_psn_edf.c')
-rw-r--r-- | litmus/sched_psn_edf.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index 3b3edfe908ff..c06db8b434cd 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c | |||
@@ -164,7 +164,7 @@ static void job_completion(struct task_struct* t, int forced) | |||
164 | prepare_for_next_period(t); | 164 | prepare_for_next_period(t); |
165 | } | 165 | } |
166 | 166 | ||
167 | static void psnedf_simple_on_exhausted(struct task_struct *t) | 167 | static enum hrtimer_restart psnedf_simple_on_exhausted(struct task_struct *t) |
168 | { | 168 | { |
169 | /* Assumption: t is scheduled on the CPU executing this callback */ | 169 | /* Assumption: t is scheduled on the CPU executing this callback */ |
170 | 170 | ||
@@ -189,6 +189,8 @@ static void psnedf_simple_on_exhausted(struct task_struct *t) | |||
189 | request_exit_np(t); | 189 | request_exit_np(t); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | |||
193 | return HRTIMER_NORESTART; | ||
192 | } | 194 | } |
193 | 195 | ||
194 | static void psnedf_tick(struct task_struct *t) | 196 | static void psnedf_tick(struct task_struct *t) |
@@ -246,8 +248,10 @@ static struct task_struct* psnedf_schedule(struct task_struct * prev) | |||
246 | if (tsk_rt(prev)->budget.ops) { | 248 | if (tsk_rt(prev)->budget.ops) { |
247 | if (blocks) | 249 | if (blocks) |
248 | tsk_rt(prev)->budget.ops->on_blocked(prev); | 250 | tsk_rt(prev)->budget.ops->on_blocked(prev); |
249 | else if (preempt || sleep) | 251 | else if (sleep) |
250 | tsk_rt(prev)->budget.ops->on_preempt_or_sleep(prev); | 252 | tsk_rt(prev)->budget.ops->on_sleep(prev); |
253 | else if (preempt) | ||
254 | tsk_rt(prev)->budget.ops->on_preempt(prev); | ||
251 | } | 255 | } |
252 | 256 | ||
253 | /* If a task blocks we have no choice but to reschedule. | 257 | /* If a task blocks we have no choice but to reschedule. |
@@ -647,7 +651,8 @@ static struct budget_tracker_ops psnedf_drain_simple_ops = | |||
647 | { | 651 | { |
648 | .on_scheduled = simple_on_scheduled, | 652 | .on_scheduled = simple_on_scheduled, |
649 | .on_blocked = simple_on_blocked, | 653 | .on_blocked = simple_on_blocked, |
650 | .on_preempt_or_sleep = simple_on_preempt_or_sleep, | 654 | .on_preempt = simple_on_preempt, |
655 | .on_sleep = simple_on_sleep, | ||
651 | .on_exit = simple_on_exit, | 656 | .on_exit = simple_on_exit, |
652 | 657 | ||
653 | .on_exhausted = psnedf_simple_on_exhausted, | 658 | .on_exhausted = psnedf_simple_on_exhausted, |