aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 0e4b3d40cd29..251c89eaf24e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3169,22 +3169,26 @@ static inline void post_schedule(struct rq *rq)
3169asmlinkage void schedule_tail(struct task_struct *prev) 3169asmlinkage void schedule_tail(struct task_struct *prev)
3170 __releases(rq->lock) 3170 __releases(rq->lock)
3171{ 3171{
3172 struct rq *rq = this_rq(); 3172 struct rq *rq;
3173
3174 preempt_disable();
3175
3176 rq = this_rq();
3177 finish_task_switch(rq, prev);
3173 3178
3174 sched_trace_task_switch_to(current); 3179 sched_trace_task_switch_to(current);
3175 3180
3176 if (sched_state_validate_switch()) {
3177 WARN_ON(1);
3178 }
3179
3180 finish_task_switch(rq, prev);
3181
3182 /* 3181 /*
3183 * FIXME: do we need to worry about rq being invalidated by the 3182 * FIXME: do we need to worry about rq being invalidated by the
3184 * task_switch? 3183 * task_switch?
3185 */ 3184 */
3186 post_schedule(rq); 3185 post_schedule(rq);
3187 3186
3187 if (sched_state_validate_switch())
3188 litmus_reschedule_local();
3189
3190 preempt_enable();
3191
3188#ifdef __ARCH_WANT_UNLOCKED_CTXSW 3192#ifdef __ARCH_WANT_UNLOCKED_CTXSW
3189 /* In this case, finish_task_switch does not reenable preemption */ 3193 /* In this case, finish_task_switch does not reenable preemption */
3190 preempt_enable(); 3194 preempt_enable();