From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 1/2] [PATCH 1/2] direct-io: implement generic deferred AIO completions Date: Thu, 20 Dec 2012 12:15:16 +0100 Message-ID: <20121220111516.GA3301@quack.suse.cz> References: <20121123075502.307482760@bombadil.infradead.org> <20121123075916.182694435@bombadil.infradead.org> <20121206190537.GD21029@quack.suse.cz> <20121208120203.GB8442@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Jeff Moyer , "Darrick J. Wong" To: Christoph Hellwig Return-path: Received: from cantor2.suse.de ([195.135.220.15]:39084 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750809Ab2LTLPS (ORCPT ); Thu, 20 Dec 2012 06:15:18 -0500 Content-Disposition: inline In-Reply-To: <20121208120203.GB8442@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat 08-12-12 07:02:03, Christoph Hellwig wrote: > On Thu, Dec 06, 2012 at 08:05:37PM +0100, Jan Kara wrote: > > I like this, but this patch already breaks ext4, doesn't it? > > > ^^^ Here ext4 offloads IO completion to a worker thread. So you now > > complete AIO / DIO before ext4_end_io() runs which is a bug (ext4_end_io() > > is responsible for example for calling end_page_writeback()). I'll modify > > these patches to work for ext4 tomorrow I hope... > > You're right, patch 2 actively deadlocks ext4 under xfstests, but the > first one already breaks semantics. So any rework of the ext4 unwritten > extent handling really should go before these two patches. Just to let you know, I didn't forget about this. I even have patches to change PageWriteback handling in ext4 but I realized it can cause deadlocks. When converting unwritten extents to written ones, we need to start a transaction, that may block because of lack of journal space waiting for currently running transaction to finish. And that running transaction never finishes because someone (e.g. ext4_write_begin()) has a handle to it waiting for PageWriteback bit (e.g. in grab_cache_page_write_begin()). I'm pondering how we could fix this in ext4 because I'd really like to get rid of that PageWriteback handling oddity in ext4. Just it's not simple... Honza -- Jan Kara SUSE Labs, CR