]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Move blk_schedule_flush_plug() out of __schedule()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 22 Jun 2011 17:47:01 +0000 (19:47 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 29 Aug 2011 10:26:59 +0000 (12:26 +0200)
commit44461313669e1ee857d9e350781ff4fe385fd36c
treecb7a48eb2a6d30b90144a55bc6bb82caacfc9622
parent861a56dc1566cb9fdd574de40ba2ca48aca8ea9f
sched: Move blk_schedule_flush_plug() out of __schedule()

There is no real reason to run blk_schedule_flush_plug() with
interrupts and preemption disabled.

Move it into schedule() and call it when the task is going voluntarily
to sleep. There might be false positives when the task is woken
between that call and actually scheduling, but that's not really
different from being woken immediately after switching away.

This fixes a deadlock in the scheduler where the
blk_schedule_flush_plug() callchain enables interrupts and thereby
allows a wakeup to happen of the task that's going to sleep.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable@kernel.org # 2.6.39+
Link: http://lkml.kernel.org/n/tip-dwfxtra7yg1b5r65m32ywtct@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c