aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2011-10-14 01:26:41 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2011-10-14 01:26:41 -0400
commit9201befffe34f93e9e37f7064717c073aeef2338 (patch)
treebf6257eb3e772907dabf174cb133d4e4546f7a85
parent361e2a6448405b1086441d08737f74be4a1f2ec8 (diff)
Removed possible super error
-rw-r--r--litmus/sched_mc.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c
index e5b5ef7ea5d1..98abb4638eb8 100644
--- a/litmus/sched_mc.c
+++ b/litmus/sched_mc.c
@@ -772,11 +772,15 @@ static void mc_task_new(struct task_struct *t, int on_rq, int running)
772 TRACE("New mixed criticality task %d\n", t->pid); 772 TRACE("New mixed criticality task %d\n", t->pid);
773 773
774 /* Assign domain */ 774 /* Assign domain */
775 if (level < CRIT_LEVEL_C) 775 if (level < CRIT_LEVEL_C) {
776 entry = &per_cpu(cpus, get_partition(t)); 776 entry = &per_cpu(cpus, get_partition(t));
777 else 777 t->rt_param._domain = entry->crit_entries[level].domain;
778 } else {
778 entry = &per_cpu(cpus, task_cpu(t)); 779 entry = &per_cpu(cpus, task_cpu(t));
779 t->rt_param._domain = entry->crit_entries[level].domain; 780 t->rt_param._domain =
781 per_cpu(cpus, 0).crit_entries[CRIT_LEVEL_C].domain;
782 }
783
780 784
781 /* Setup job params */ 785 /* Setup job params */
782 release_at(t, litmus_clock()); 786 release_at(t, litmus_clock());
@@ -784,8 +788,13 @@ static void mc_task_new(struct task_struct *t, int on_rq, int running)
784 tsk_mc_data(t)->mc_job.is_ghost = 0; 788 tsk_mc_data(t)->mc_job.is_ghost = 0;
785 if (running) { 789 if (running) {
786 BUG_ON(entry->scheduled); 790 BUG_ON(entry->scheduled);
787 entry->scheduled = t; 791 if (entry->cpu != CONFIG_FTRACE_CPU) {
788 tsk_rt(t)->scheduled_on = entry->cpu; 792 entry->scheduled = t;
793 tsk_rt(t)->scheduled_on = entry->cpu;
794 } else {
795 tsk_rt(t)->scheduled_on = NO_CPU;
796 preempt_if_preemptable(NULL, entry->cpu);
797 }
789 } else { 798 } else {
790 t->rt_param.scheduled_on = NO_CPU; 799 t->rt_param.scheduled_on = NO_CPU;
791 } 800 }
@@ -891,16 +900,14 @@ static struct task_struct* mc_schedule(struct task_struct* prev)
891 unsigned long flags; 900 unsigned long flags;
892 struct domain *dom; 901 struct domain *dom;
893 struct crit_entry *ce; 902 struct crit_entry *ce;
894 struct cpu_entry* entry; 903 struct cpu_entry* entry = &__get_cpu_var(cpus);
895 int i, out_of_time, sleep, preempt, exists, blocks, global, lower; 904 int i, out_of_time, sleep, preempt, exists, blocks, global, lower;
896 struct task_struct *dtask = NULL, *ready_task = NULL, *next = NULL; 905 struct task_struct *dtask = NULL, *ready_task = NULL, *next = NULL;
897 906
898 /* Give FTRACE a CPU to run on */ 907 /* Give FTRACE a CPU to run on */
899 if (CONFIG_FTRACE_CPU == smp_processor_id()) 908 if (CONFIG_FTRACE_CPU == entry->cpu)
900 return NULL; 909 return NULL;
901 910
902 entry = &__get_cpu_var(cpus);
903
904 local_irq_save(flags); 911 local_irq_save(flags);
905 912
906 /* Litmus gave up because it couldn't access the stack of the CPU 913 /* Litmus gave up because it couldn't access the stack of the CPU
@@ -1212,13 +1219,16 @@ static int __init init_mc(void)
1212 cpumask_xor(&rt_mask, cpu_online_mask, cpumask_of(CONFIG_FTRACE_CPU)); 1219 cpumask_xor(&rt_mask, cpu_online_mask, cpumask_of(CONFIG_FTRACE_CPU));
1213#endif 1220#endif
1214 1221
1215 for_each_rt_cpu(cpu) { 1222 for_each_online_cpu(cpu) {
1216 entry = &per_cpu(cpus, cpu); 1223 entry = &per_cpu(cpus, cpu);
1217 1224
1218 /* CPU */ 1225 /* CPU */
1219 entry->cpu = cpu; 1226 entry->cpu = cpu;
1220 entry->scheduled = NULL; 1227 entry->scheduled = NULL;
1221 entry->linked = NULL; 1228 entry->linked = NULL;
1229
1230 if (cpu == CONFIG_FTRACE_CPU)
1231 continue;
1222 raw_spin_lock_init(&entry->lock); 1232 raw_spin_lock_init(&entry->lock);
1223 1233
1224#ifdef CONFIG_PLUGIN_MC_REDIRECT 1234#ifdef CONFIG_PLUGIN_MC_REDIRECT