From: Jan Kara Subject: Re: [PATCH 3/7] writeback: Move I_DIRTY_PAGES handling Date: Mon, 30 Apr 2012 23:21:12 +0200 Message-ID: <20120430212112.GA10105@quack.suse.cz> References: <1332284191-21076-1-git-send-email-jack@suse.cz> <1332284191-21076-4-git-send-email-jack@suse.cz> <20120430144138.GD10964@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , Wu Fengguang , linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from cantor2.suse.de ([195.135.220.15]:35146 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754920Ab2D3VVO (ORCPT ); Mon, 30 Apr 2012 17:21:14 -0400 Content-Disposition: inline In-Reply-To: <20120430144138.GD10964@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon 30-04-12 10:41:38, Christoph Hellwig wrote: > On Tue, Mar 20, 2012 at 11:56:27PM +0100, Jan Kara wrote: > > Instead of clearing I_DIRTY_PAGES and resetting it when we didn't succeed in > > writing them all, just clear the bit only when we succeeded writing all the > > pages. We also move the clearing of the bit close to other i_state handling to > > separate it from writeback list handling. This is desirable because list > > handling will differ for flusher thread and other writeback_single_inode() > > callers in future. No filesystem plays any tricks with I_DIRTY_PAGES (like > > checking it in ->writepages or ->write_inode implementation) so this movement > > is safe. > > Looks good to me, > > Reviewed-by: Christoph Hellwig Thanks for review. > In addition to this cleanup I wonder if we could go further and just > kill I_DIRTY_PAGES off. I can't see any value add over using > mapping_tagged(mapping, PAGECACHE_TAG_DIRTY), which has the big benefit > of beeing managed transparently by the pagecache radix tree. The only reason I can thing off is that checking whether inode is dirty is simpler with I_DIRTY_PAGES. Without it the check would have to be (inode->i_state & I_DIRTY) || mapping_tagged(inode->i_mapping, PAGECACHE_TAG_DIRTY) which would need a separate helper function I guess. Honza -- Jan Kara SUSE Labs, CR