From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: kjournald() with DIO Date: Fri, 16 Sep 2005 00:04:59 +0200 Message-ID: <20050915220459.GO4122@opteron.random> References: <20050914111809.41c5b395.akpm@osdl.org> <1126734025.4010.21.camel@localhost.localdomain> <20050914150224.3b6d7051.akpm@osdl.org> <1126796604.14837.111.camel@dyn9047017102.beaverton.ibm.com> <20050915192225.GJ4122@opteron.random> <20050915130018.287270e4.akpm@osdl.org> <20050915202019.GK4122@opteron.random> <20050915133500.754a8b4d.akpm@osdl.org> <20050915210358.GL4122@opteron.random> <20050915142642.05f3d75e.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: pbadari@us.ibm.com, cmm@us.ibm.com, linux-fsdevel@vger.kernel.org, sct@redhat.com Return-path: Received: from ppp-217-133-42-200.cust-adsl.tiscali.it ([217.133.42.200]:19496 "EHLO opteron.random") by vger.kernel.org with ESMTP id S965283AbVIOWEr (ORCPT ); Thu, 15 Sep 2005 18:04:47 -0400 To: Andrew Morton Content-Disposition: inline In-Reply-To: <20050915142642.05f3d75e.akpm@osdl.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Sep 15, 2005 at 02:26:42PM -0700, Andrew Morton wrote: > Bear in mind that generic_file_direct_IO() has just fsynced that section of > the file so there shouldn't be any dirty buffers unless something funny is That was clear yes, or we cannot start writing to the platter if there's outstanding dirty cache. > happening. Like, direct-io fell back to buffered IO. In that case perhaps > we should run sync_page_range() before trying the > invalidate_inode_pages2_range()? The buffered-IO fallback would happen _after_ (not before) the invalidate regardless so it doesn't matter since the pages would be marked dirty again later (still inside write context so we're safe). The fallback actually happens outside generic_file_direct_IO, so it doesn't matter what we do inside since we'll rewrite and redirty all pagecache later (if we fail the direct-IO). > Those dirty pages/buffers could be there because > __generic_file_aio_write_nolock() fell back to buffered I/O. > > If we run sync_page_range() before invalidate_inode_pages2_range() and we > *still* find dirty pages/buffers then yes, it might be right to simply nuke > those dirty bits. See above, it doesn't seem necessary.