From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: kjournald() with DIO Date: Fri, 16 Sep 2005 02:18:44 +0200 Message-ID: <20050916001844.GQ4122@opteron.random> References: <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> <20050915220459.GO4122@opteron.random> <1126826924.3885.6.camel@dyn9047017116.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , pbadari@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]:24679 "EHLO opteron.random") by vger.kernel.org with ESMTP id S965297AbVIPASb (ORCPT ); Thu, 15 Sep 2005 20:18:31 -0400 To: Mingming Cao Content-Disposition: inline In-Reply-To: <1126826924.3885.6.camel@dyn9047017116.beaverton.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Sep 15, 2005 at 04:28:44PM -0700, Mingming Cao wrote: > Isn't direct-io and buffered IO being serialized by i_sem? If so, the page faults aren't serialized by i_sem, so if a page fault happens the vm may unmap the pte under memory pressure marking the page dirty. But we have the guarantee that such dirty bit in the pte was set after we were inside write() so we can drop it (or we can as well leave it), it's undefined. but the point is that the buffered-io fallback happens after the invalidate, so it shouldn't matter if we drop dirty buffers or dirty pages in the invalidate, they should be re-generated. So overall I believe it's semantically equivalent if we drop the dirty bits or not. Clearly not dropping them is a bit less intrusive, but current code seems ready to drop them by calling ->invalidatepage (destructive) instead of creating a blocking version of ->releasepage (non destructive).