From: Nick Piggin Subject: Re: [PATCH 06/43] FS-Cache: Recruit a couple of page flags for cache management [ver #46] Date: Fri, 3 Apr 2009 00:55:25 +1100 Message-ID: <200904030055.26668.nickpiggin@yahoo.com.au> References: <20090401230321.28177.12010.stgit@warthog.procyon.org.uk> <20090401230352.28177.65878.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0589753461==" Cc: linux-fsdevel@vger.kernel.org, nfsv4@linux-nfs.org, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org To: David Howells Return-path: In-Reply-To: <20090401230352.28177.65878.stgit@warthog.procyon.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: nfsv4-bounces@linux-nfs.org Errors-To: nfsv4-bounces@linux-nfs.org List-Id: linux-fsdevel.vger.kernel.org --===============0589753461== Content-Type: multipart/alternative; boundary="Boundary-00=_OPM1J8TzHFdM29K" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-00=_OPM1J8TzHFdM29K Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thursday 02 April 2009 10:03:52 David Howells wrote: > Recruit a couple of page flags to aid in cache management. The following > extra flags are defined: > > (1) PG_fscache (PG_private_2) > > The marked page is backed by a local cache and is pinning resources in > the cache driver. > > (2) PG_fscache_write (PG_owner_priv_2) > > The marked page is being written to the local cache. The page may not > be modified whilst this is in progress. > > If PG_fscache is set, then things that checked for PG_private will now also > check for that. This includes things like truncation and page > invalidation. The function page_has_private() had been added to make the > checks for both PG_private and PG_private_2 at the same time. 2 new page flags? Ouch. 1) PG_mappedtodisk is basically PG_owner_priv_2. Please alias that and use it? Then at least we're down to 1 extra flag. 2) Why do you need another PG_private? PG_private for pagecache means that it should call into the filesystem when it needs to handle fs data attached to the page, right? So PG_private_2 doesn't really make sense in that respect. Can't you just keep another flag privately in the fs and distinguish what to do based on that? > Signed-off-by: David Howells > Acked-by: Steve Dickson > Acked-by: Trond Myklebust > --- > > fs/splice.c | 3 ++- > include/linux/page-flags.h | 41 > ++++++++++++++++++++++++++++++++++++----- include/linux/pagemap.h | 14 > ++++++++++++++ > mm/filemap.c | 18 ++++++++++++++++++ > mm/migrate.c | 10 +++++----- > mm/readahead.c | 9 +++++---- > mm/swap.c | 4 ++-- > mm/truncate.c | 10 +++++----- > mm/vmscan.c | 6 +++--- > 9 files changed, 90 insertions(+), 25 deletions(-) --Boundary-00=_OPM1J8TzHFdM29K Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit

On Thursday 02 April 2009 10:03:52 David Howells wrote:

> Recruit a couple of page flags to aid in cache management. The following

> extra flags are defined:

>

> (1) PG_fscache (PG_private_2)

>

> The marked page is backed by a local cache and is pinning resources in

> the cache driver.

>

> (2) PG_fscache_write (PG_owner_priv_2)

>

> The marked page is being written to the local cache. The page may not

> be modified whilst this is in progress.

>

> If PG_fscache is set, then things that checked for PG_private will now also

> check for that. This includes things like truncation and page

> invalidation. The function page_has_private() had been added to make the

> checks for both PG_private and PG_private_2 at the same time.

2 new page flags? Ouch.

1) PG_mappedtodisk is basically PG_owner_priv_2. Please alias that and

use it? Then at least we're down to 1 extra flag.

2) Why do you need another PG_private? PG_private for pagecache means

that it should call into the filesystem when it needs to handle fs data

attached to the page, right? So PG_private_2 doesn't really make sense

in that respect. Can't you just keep another flag privately in the fs

and distinguish what to do based on that?

> Signed-off-by: David Howells <dhowells@redhat.com>

> Acked-by: Steve Dickson <steved@redhat.com>

> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>

> ---

>

> fs/splice.c | 3 ++-

> include/linux/page-flags.h | 41

> ++++++++++++++++++++++++++++++++++++----- include/linux/pagemap.h | 14

> ++++++++++++++

> mm/filemap.c | 18 ++++++++++++++++++

> mm/migrate.c | 10 +++++-----

> mm/readahead.c | 9 +++++----

> mm/swap.c | 4 ++--

> mm/truncate.c | 10 +++++-----

> mm/vmscan.c | 6 +++---

> 9 files changed, 90 insertions(+), 25 deletions(-)

--Boundary-00=_OPM1J8TzHFdM29K-- --===============0589753461== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ NFSv4 mailing list NFSv4@linux-nfs.org http://linux-nfs.org/cgi-bin/mailman/listinfo/nfsv4 --===============0589753461==--