From c537a10b8b94bef12cbc52294bdcf81d9725ea29 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sun, 17 May 2020 19:45:44 +0000 Subject: Remove usage of `scheduled_on` This optional portion of `rt_param` was maintained incorrectly, and is actually completely uneeded. It was only in here because we errantly inherited it from GSN-EDF. --- litmus/sched_edfsc.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/litmus/sched_edfsc.c b/litmus/sched_edfsc.c index 7ab164cab3e1..0a7d8131ab54 100644 --- a/litmus/sched_edfsc.c +++ b/litmus/sched_edfsc.c @@ -546,7 +546,6 @@ static void g_finish_switch(struct task_struct *prev) // but because it's not a real task, a non-rt task is current instead else if (is_container(entry->linked)) { entry->scheduled = entry->linked; - entry->scheduled->rt_param.scheduled_on = entry->cpu; } // This handles requeuing when a container is descheduled @@ -694,7 +693,7 @@ static struct task_struct *edfsc_gschedule(struct task_struct *prev) // jobs of fixed tasks. BUG_ON(entry->scheduled && !is_container(entry->scheduled) && !is_realtime(prev)); // Bug if we didn't think anything was scheduled, but a realtime task was running on our CPU - BUG_ON(is_realtime(prev) && !entry->scheduled && entry->cpu == tsk_rt(prev)->scheduled_on); + BUG_ON(is_realtime(prev) && tsk_rt(prev)->linked_on != NO_CPU && !entry->scheduled); if (is_container(entry->scheduled)) { lt_t now = litmus_clock(); @@ -794,14 +793,12 @@ static struct task_struct *edfsc_gschedule(struct task_struct *prev) if ((!np || blocks) && entry->linked != entry->scheduled) { /* Schedule a linked job? */ if (entry->linked) { - entry->linked->rt_param.scheduled_on = entry->cpu; next = entry->linked; - TRACE_TASK(next, "scheduled_on = P%d\n", smp_processor_id()); + TRACE_TASK(next, "scheduled on P%d\n", smp_processor_id()); } + // Note what was running before if (entry->scheduled) { - /* not gonna be scheduled soon */ - entry->scheduled->rt_param.scheduled_on = NO_CPU; - TRACE_TASK(entry->scheduled, "scheduled_on = NO_CPU\n"); + TRACE_TASK(entry->scheduled, "descheduled\n"); } } else if (entry->scheduled) { // If we've been running a container, make sure that it has nothing new to schedule @@ -1066,7 +1063,6 @@ static void edfsc_task_new(struct task_struct* t, int on_rq, int is_scheduled) preempt(entry); // Since `t` is not going to run again until we schedule, harmonize state - t->rt_param.scheduled_on = NO_CPU; t->rt_param.linked_on = NO_CPU; raw_spin_unlock_irqrestore(&g_lock, flags); @@ -1123,9 +1119,8 @@ static void edfsc_task_exit(struct task_struct* t) } else { // We're in the global domain and not on the ready queues, so we must be running BUG_ON(t != current); - BUG_ON(tsk_rt(t)->scheduled_on == NO_CPU); list_del(&t->edfsc_qnode); - entry = &per_cpu(edfsc_cpu_entries, tsk_rt(t)->scheduled_on); + entry = &per_cpu(edfsc_cpu_entries, task_cpu(t)); BUG_ON(entry->scheduled != t); entry->scheduled = NULL; } -- cgit v1.2.2