diff options
Diffstat (limited to 'kernel/sched/litmus.c')
-rw-r--r-- | kernel/sched/litmus.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/kernel/sched/litmus.c b/kernel/sched/litmus.c index 4fa5a941a284..8eb9df31ea01 100644 --- a/kernel/sched/litmus.c +++ b/kernel/sched/litmus.c | |||
@@ -121,45 +121,21 @@ litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
121 | } | 121 | } |
122 | #endif | 122 | #endif |
123 | double_rq_lock(rq, other_rq); | 123 | double_rq_lock(rq, other_rq); |
124 | mb(); | ||
125 | if (is_realtime(current) && is_current_running() != was_running) { | ||
126 | TRACE_TASK(prev, | ||
127 | "state changed while we dropped" | ||
128 | " the lock: is_running=%d, was_running=%d\n", | ||
129 | is_current_running(), was_running); | ||
130 | if (is_current_running() && !was_running) { | ||
131 | /* prev task became unblocked | ||
132 | * we need to simulate normal sequence of events | ||
133 | * to scheduler plugins. | ||
134 | */ | ||
135 | litmus->task_block(prev); | ||
136 | litmus->task_wake_up(prev); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | set_task_cpu(next, smp_processor_id()); | 124 | set_task_cpu(next, smp_processor_id()); |
141 | |||
142 | /* DEBUG: now that we have the lock we need to make sure a | ||
143 | * couple of things still hold: | ||
144 | * - it is still a real-time task | ||
145 | * - it is still runnable (could have been stopped) | ||
146 | * If either is violated, then the active plugin is | ||
147 | * doing something wrong. | ||
148 | */ | ||
149 | if (!is_realtime(next) || !tsk_rt(next)->present) { | ||
150 | /* BAD BAD BAD */ | ||
151 | TRACE_TASK(next,"BAD: migration invariant FAILED: " | ||
152 | "rt=%d present=%d\n", | ||
153 | is_realtime(next), | ||
154 | tsk_rt(next)->present); | ||
155 | /* drop the task */ | ||
156 | next = NULL; | ||
157 | } | ||
158 | /* release the other CPU's runqueue, but keep ours */ | 125 | /* release the other CPU's runqueue, but keep ours */ |
159 | raw_spin_unlock(&other_rq->lock); | 126 | raw_spin_unlock(&other_rq->lock); |
160 | } | 127 | } |
161 | #endif | 128 | #endif |
162 | 129 | ||
130 | /* check if the task became invalid while we dropped the lock */ | ||
131 | if (next && (!is_realtime(next) || !tsk_rt(next)->present)) { | ||
132 | TRACE_TASK(next, | ||
133 | "BAD: next (no longer?) valid\n"); | ||
134 | litmus->next_became_invalid(next); | ||
135 | litmus_reschedule_local(); | ||
136 | next = NULL; | ||
137 | } | ||
138 | |||
163 | if (next) { | 139 | if (next) { |
164 | #ifdef CONFIG_SMP | 140 | #ifdef CONFIG_SMP |
165 | next->rt_param.stack_in_use = rq->cpu; | 141 | next->rt_param.stack_in_use = rq->cpu; |