Skip to content

Commit

Permalink
sched: Reenable interrupts in do_sched_yield()
Browse files Browse the repository at this point in the history
[ Upstream commit 345a957 ]

do_sched_yield() invokes schedule() with interrupts disabled which is
not allowed. This goes back to the pre git era to commit a6efb709806c
("[PATCH] irqlock patch 2.5.27-H6") in the history tree.

Reenable interrupts and remove the misleading comment which "explains" it.

Fixes: 1da177e ("Linux-2.6.12-rc2")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/87r1pt7y5c.fsf@nanos.tec.linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Thomas Gleixner authored and gregkh committed Dec 30, 2020
1 parent 35975f2 commit 52f525f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions kernel/sched/core.c
Expand Up @@ -5679,12 +5679,8 @@ static void do_sched_yield(void)
schedstat_inc(rq->yld_count);
current->sched_class->yield_task(rq);

/*
* Since we are going to call schedule() anyway, there's
* no need to preempt or enable interrupts:
*/
preempt_disable();
rq_unlock(rq, &rf);
rq_unlock_irq(rq, &rf);
sched_preempt_enable_no_resched();

schedule();
Expand Down

0 comments on commit 52f525f

Please sign in to comment.