From: Andrew Morton Subject: Re: writethrough of mmapped pages Date: Fri, 30 Jan 2004 16:02:18 -0800 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040130160218.5b485e44.akpm@osdl.org> References: <1075505404.2322.9.camel@stevef95.austin.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from fw.osdl.org ([65.172.181.6]:63714 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S264391AbUAaAAx (ORCPT ); Fri, 30 Jan 2004 19:00:53 -0500 To: Steve French In-Reply-To: <1075505404.2322.9.camel@stevef95.austin.ibm.com> List-Id: linux-fsdevel.vger.kernel.org Steve French wrote: > > Is there an easy way to locally force the page cache to do in effect > writethrough of mmapped pages (when I lose my write caching token in > cifs vfs e.g.)? Standard writes can be hooked easily enough by wrapping > the inode operation for write and only calling generic_write if they are > (still) cacheable locally which is what I do in current code, but > mmapped writes still go through the page cache presumably and thus would > have to be synced if a non-mmmapped read followed an mmapped write of an > overlapping range. You mean that you want the filesytem to know whenever an application attempts to modify a mmapped page? After the modification, rather than before? Not sure how to do that - even if you modify the MM to take a trap on every write the page still hasn't been modified on entry to the fault handler.