Re: [PATCH RT] fs: jbd2: pull your plug when waiting for space
From: Mike Galbraith
Date: Tue Mar 11 2014 - 00:13:28 EST
On Mon, 2014-03-10 at 13:47 -0400, Theodore Ts'o wrote:
> On Fri, Feb 21, 2014 at 02:54:12PM +0100, Mike Galbraith wrote:
> >
> > ext3: dbench1 queues a buffer, blocks on journal mutex, it's plug is not
> > pulled. dbench2 mutex owner is waiting for kjournald, who is waiting for
> > the buffer queued by dbench1. Game over.
>
> Where is in ext3/4 are we calling some function which could end up
> blocking on kjournald while we have the I/O queue plugged? That
> sounds suspicious and potentially wrong.
I don't have the crash dumps and analysis handy, this was quite some
time ago. Problem is that..
static inline void sched_submit_work(struct task_struct *tsk)
{
if (!tsk->state || tsk_is_pi_blocked(tsk))
return;
/*
* If we are going to sleep and we have plugged IO queued,
* make sure to submit it to avoid deadlocks.
*/
if (blk_needs_flush_plug(tsk))
blk_schedule_flush_plug(tsk);
}
..tsk_is_pi_blocked(tsk) leaves us with IO queued, dependency on which
can (_did_ for ext[34] and xfs that I recall) end up with our waker
waiting on our IO. There were other deadlock scenarios, not only the
one in the quoted text.
-Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/