[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080521003849.0aabac4b.akpm@linux-foundation.org>
Date: Wed, 21 May 2008 00:38:49 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Hisashi Hifumi <hifumi.hisashi@....ntt.co.jp>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] VFS: Pagecache usage optimization on pagesize !=
blocksize environment
On Wed, 21 May 2008 00:19:30 -0700 Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> I guess a suitable fix might be to implement the above using a new
> address_space_operations callback:
>
> if (PagePrivate(page) && aops->is_partially_uptodate) {
This is a bit presumptuous. A filesytem could in theory be able to
work out if a section of a page is uptodate without necessarily
maintaining per-page metadata at page.private.
So one really should just do
if (aops->is_partially_uptodate)
however it's hard to conceive how a filesystem could sanely do this
_without_ putting data at page.private, so the PagePrivate() test could
perhaps be retained as a microoptimisation, as long as it is suitably
commented.
otoh, non-zero aops->is_partially_uptodate might well be less common
than non-zero PagePrivate(), so perhaps these should be tested in the
other order. Not sure.
> if (aops->is_partially_uptodate(page, desc, offset))
> <OK, we can copy the data>
>
> then implement a generic_file_is_partially_uptodate() in fs/buffer.c
Make that block_is_partially_uptodate().
> and wire that up in the filesystems.
>
> Note that things like network filesystems can then implement this also.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists