aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZelin Tong <ztong@ludwig.cs.unc.edu>2020-03-05 12:38:49 -0500
committerZelin Tong <ztong@ludwig.cs.unc.edu>2020-03-05 12:38:49 -0500
commit2a258b89af94406f23a1d93cc097de0bf91c45ff (patch)
tree35c1d6554af61b09e2a59354c9a8f28258741d69
parent6cd4356d6003c8f57ee518575cf91526fe1ed9f0 (diff)
parent1e7ce74ffc79b0959897c99e180cdb422a351ad6 (diff)
Merge branch 'edfsc-wip' of rtsrv.cs.unc.edu:/public/litmus-rt-edfsc into edfsc-wip
-rw-r--r--litmus/sched_edfsc.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/litmus/sched_edfsc.c b/litmus/sched_edfsc.c
index a787fd5a040d..218123d99514 100644
--- a/litmus/sched_edfsc.c
+++ b/litmus/sched_edfsc.c
@@ -544,10 +544,13 @@ static int fifo_prio(struct bheap_node* _a, struct bheap_node* _b)
544 return 0; 544 return 0;
545} 545}
546 546
547// takes in the container_domain pointer in container task_struct 547/**
548// assuming prev is previous task running on the processor before calling schedule 548 * Schedule inside of a container domain
549// global lock in effect 549 * Called with g_lock already held
550// returns container if no fixed task is next 550 * @param cedf Pointer to tsk_rt(container)->edfsc_params->domain
551 * @param prev Previous task running on this processor before schedule was called
552 * @returns `cedf->container` if no fixed task is next
553 */
551static struct task_struct* edfsc_cschedule(cont_domain_t* cedf, struct task_struct * prev) 554static struct task_struct* edfsc_cschedule(cont_domain_t* cedf, struct task_struct * prev)
552{ 555{
553 rt_domain_t *edf = &cedf->domain; 556 rt_domain_t *edf = &cedf->domain;
@@ -797,15 +800,9 @@ static struct task_struct *edfsc_gschedule(struct task_struct *prev)
797 TRACE_TASK(entry->scheduled, "scheduled_on = NO_CPU\n"); 800 TRACE_TASK(entry->scheduled, "scheduled_on = NO_CPU\n");
798 } 801 }
799 } else { 802 } else {
800 // When a fixed task is released, it causes gschedule to be called
801 // however, when entry->scheduled is a previously empty container,
802 // prev can be a non-rt task. In which case, we can only set next = prev
803 // when cschedule finds nothing to schedule on the container
804 BUG_ON(entry->linked != entry->scheduled); 803 BUG_ON(entry->linked != entry->scheduled);
805 if (is_container(entry->scheduled)) 804 if (is_container(entry->scheduled))
806 next = edfsc_cschedule(tsk_rt(entry->scheduled)->edfsc_params.domain, prev); 805 next = edfsc_cschedule(tsk_rt(entry->scheduled)->edfsc_params.domain, prev);
807 if (exists && is_container(next))
808 next = prev;
809 } 806 }
810 807
811 sched_state_task_picked(); 808 sched_state_task_picked();
@@ -821,6 +818,7 @@ static struct task_struct *edfsc_gschedule(struct task_struct *prev)
821 TRACE("becomes idle at %llu.\n", litmus_clock()); 818 TRACE("becomes idle at %llu.\n", litmus_clock());
822#endif 819#endif
823 820
821 // If next is a container, then edfsc_cschedule() found nothing to schedule
824 if (is_container(next)) { 822 if (is_container(next)) {
825 manage_idle_enforcement_timer(next); 823 manage_idle_enforcement_timer(next);
826 return NULL; 824 return NULL;