diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2011-01-23 17:10:34 -0500 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2011-01-23 17:10:34 -0500 |
commit | f65a757c660f34e9ac1da234613967f7a0abacbc (patch) | |
tree | acb629dd04cffcf603aa1c8cddab9ee4f0f50f70 | |
parent | 50251cbf3d36c5da36b2c74be223827c48f60a1a (diff) |
Clean up logic
-rw-r--r-- | litmus/sched_mc.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c index aafe3e095c2a..0f11683cdd9f 100644 --- a/litmus/sched_mc.c +++ b/litmus/sched_mc.c | |||
@@ -757,7 +757,6 @@ static noinline void job_completion(struct task_struct *t, int forced) | |||
757 | cpu = remote_cpu_entry(t->rt_param.scheduled_on); | 757 | cpu = remote_cpu_entry(t->rt_param.scheduled_on); |
758 | /*Unlink first while it's not a ghost job.*/ | 758 | /*Unlink first while it's not a ghost job.*/ |
759 | unlink(t); | 759 | unlink(t); |
760 | already_unlinked = 1; | ||
761 | t->rt_param.job_params.ghost_budget = budget_remaining(t); | 760 | t->rt_param.job_params.ghost_budget = budget_remaining(t); |
762 | t->rt_param.job_params.is_ghost = 1; | 761 | t->rt_param.job_params.is_ghost = 1; |
763 | /* If we did just convert the job to ghost, we can safely | 762 | /* If we did just convert the job to ghost, we can safely |
@@ -776,24 +775,18 @@ static noinline void job_completion(struct task_struct *t, int forced) | |||
776 | return; | 775 | return; |
777 | } | 776 | } |
778 | } | 777 | } |
779 | /* prepare for next period */ | 778 | /* prepare for next period - we either just became ghost but with no |
779 | * budget left, or we were already ghost and the ghost job expired*/ | ||
780 | if (is_ghost(t)) { | 780 | if (is_ghost(t)) { |
781 | t->rt_param.job_params.ghost_budget = 0; | 781 | t->rt_param.job_params.ghost_budget = 0; |
782 | /*Need to unlink here so prepare_for_next_period doesn't try | 782 | /*Need to unlink here so prepare_for_next_period doesn't try |
783 | * to unlink us | 783 | * to unlink us |
784 | */ | 784 | */ |
785 | unlink(t); | 785 | unlink(t); |
786 | already_unlinked = 1; | ||
787 | prepare_for_next_period(t); | 786 | prepare_for_next_period(t); |
788 | } | 787 | } |
789 | else { | ||
790 | t->rt_param.job_params.ghost_budget = budget_remaining(t); | ||
791 | } | ||
792 | if (is_released(t, litmus_clock())) | 788 | if (is_released(t, litmus_clock())) |
793 | sched_trace_task_release(t); | 789 | sched_trace_task_release(t); |
794 | /* unlink if we didn't above */ | ||
795 | if (!already_unlinked) | ||
796 | unlink(t); | ||
797 | /* requeue | 790 | /* requeue |
798 | * But don't requeue a blocking task. */ | 791 | * But don't requeue a blocking task. */ |
799 | if (is_running(t)) | 792 | if (is_running(t)) |