All of lore.kernel.org
 help / color / mirror / Atom feed
* sched: Reenable interrupts in do sched_yield()
@ 2020-10-20 14:46 Thomas Gleixner
  2020-10-20 15:38 ` Steven Rostedt
  2020-10-29 10:51 ` [tip: sched/core] sched: Reenable interrupts in do_sched_yield() tip-bot2 for Thomas Gleixner
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Gleixner @ 2020-10-20 14:46 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Ingo Molnar, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira

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: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/sched/core.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6094,12 +6094,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();

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-23 12:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 14:46 sched: Reenable interrupts in do sched_yield() Thomas Gleixner
2020-10-20 15:38 ` Steven Rostedt
2020-10-20 18:02   ` Thomas Gleixner
2020-10-20 20:07     ` Steven Rostedt
2020-10-21  7:27       ` Thomas Gleixner
2020-10-21 14:07         ` Steven Rostedt
2020-12-23 12:02           ` Qais Yousef
2020-10-29 10:51 ` [tip: sched/core] sched: Reenable interrupts in do_sched_yield() tip-bot2 for Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.