aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 2229d0deec4b..65aba7ec564d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3163,16 +3163,26 @@ static inline void post_schedule(struct rq *rq)
3163asmlinkage void schedule_tail(struct task_struct *prev) 3163asmlinkage void schedule_tail(struct task_struct *prev)
3164 __releases(rq->lock) 3164 __releases(rq->lock)
3165{ 3165{
3166 struct rq *rq = this_rq(); 3166 struct rq *rq;
3167 3167
3168 preempt_disable();
3169
3170 rq = this_rq();
3168 finish_task_switch(rq, prev); 3171 finish_task_switch(rq, prev);
3169 3172
3173 sched_trace_task_switch_to(current);
3174
3170 /* 3175 /*
3171 * FIXME: do we need to worry about rq being invalidated by the 3176 * FIXME: do we need to worry about rq being invalidated by the
3172 * task_switch? 3177 * task_switch?
3173 */ 3178 */
3174 post_schedule(rq); 3179 post_schedule(rq);
3175 3180
3181 if (sched_state_validate_switch())
3182 litmus_reschedule_local();
3183
3184 preempt_enable();
3185
3176#ifdef __ARCH_WANT_UNLOCKED_CTXSW 3186#ifdef __ARCH_WANT_UNLOCKED_CTXSW
3177 /* In this case, finish_task_switch does not reenable preemption */ 3187 /* In this case, finish_task_switch does not reenable preemption */
3178 preempt_enable(); 3188 preempt_enable();