From 040301747953ae9a2017def70e6004affe1e9aeb Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Wed, 25 Apr 2012 19:30:48 -0400 Subject: Fix/test C-EDF for GPU RTSS12. --- litmus/sched_cedf.c | 32 +++++++++++++++++++++----------- litmus/sched_gsn_edf.c | 2 -- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c index aa350bb7eabc..e78ff0ade237 100644 --- a/litmus/sched_cedf.c +++ b/litmus/sched_cedf.c @@ -718,17 +718,29 @@ static void cedf_change_prio_pai_tasklet(struct task_struct *old_prio, { struct tasklet_struct* step; unsigned long flags; - cedf_domain_t *cluster = task_cpu_cluster(old_prio); + cedf_domain_t *cluster; + struct task_struct *probe; + + // identify the cluster by the assignment of these tasks. one should + // be non-NULL. + probe = (old_prio) ? old_prio : new_prio; + + if(probe) { + cluster = task_cpu_cluster(probe); - if(cluster->pending_tasklets.head != NULL) { - raw_spin_lock_irqsave(&cluster->cluster_lock, flags); - for(step = cluster->pending_tasklets.head; step != NULL; step = step->next) { - if(step->owner == old_prio) { - TRACE("%s: Found tasklet to change: %d\n", __FUNCTION__, step->owner->pid); - step->owner = new_prio; + if(cluster->pending_tasklets.head != NULL) { + raw_spin_lock_irqsave(&cluster->cluster_lock, flags); + for(step = cluster->pending_tasklets.head; step != NULL; step = step->next) { + if(step->owner == old_prio) { + TRACE("%s: Found tasklet to change: %d\n", __FUNCTION__, step->owner->pid); + step->owner = new_prio; + } } + raw_spin_unlock_irqrestore(&cluster->cluster_lock, flags); } - raw_spin_unlock_irqrestore(&cluster->cluster_lock, flags); + } + else { + TRACE("%s: Both priorities were NULL\n"); } } @@ -900,7 +912,7 @@ static void cedf_task_new(struct task_struct * t, int on_rq, int running) cpu_entry_t* entry; cedf_domain_t* cluster; - TRACE("gsn edf: task new %d\n", t->pid); + TRACE("c-edf: task new %d\n", t->pid); /* the cluster doesn't change even if t is running */ cluster = task_cpu_cluster(t); @@ -1467,7 +1479,6 @@ static long cedf_allocate_lock(struct litmus_lock **lock, int type, { int err; - /* GSN-EDF currently only supports the FMLP for global resources. */ switch (type) { #ifdef CONFIG_LITMUS_NESTED_LOCKING case RSM_MUTEX: @@ -1518,7 +1529,6 @@ static long cedf_allocate_affinity_observer(struct affinity_observer **aff_obs, { int err; - /* GSN-EDF currently only supports the FMLP for global resources. */ switch (type) { case KFMLP_SIMPLE_GPU_AFF_OBS: diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index 16f532d690cb..8c48757fa86c 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c @@ -1654,7 +1654,6 @@ static long gsnedf_allocate_lock(struct litmus_lock **lock, int type, { int err; - /* GSN-EDF currently only supports the FMLP for global resources. */ switch (type) { case FMLP_SEM: @@ -1713,7 +1712,6 @@ static long gsnedf_allocate_affinity_observer( { int err; - /* GSN-EDF currently only supports the FMLP for global resources. */ switch (type) { case KFMLP_SIMPLE_GPU_AFF_OBS: -- cgit v1.2.2