summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/sched/core.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index cde848149dd6..b4935600cd85 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2309,15 +2309,14 @@ static inline void post_schedule(struct rq *rq)
asmlinkage __visible void schedule_tail(struct task_struct *prev)
__releases(rq->lock)
{
- struct rq *rq = this_rq();
+ struct rq *rq;
+ /* finish_task_switch() drops rq->lock and enables preemtion */
+ preempt_disable();
+ rq = this_rq();
finish_task_switch(rq, prev);
-
- /*
- * FIXME: do we need to worry about rq being invalidated by the
- * task_switch?
- */
post_schedule(rq);
+ preempt_enable();
if (current->set_child_tid)
put_user(task_pid_vnr(current), current->set_child_tid);