Re: [PATCH 1/9] readahead: introduce PG_readahead
From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-05-19 15:30:30
Also in:
lkml
On Sat, 19 May 2007 20:30:31 +0800 Fengguang Wu [off-list ref] wrote:
On Fri, May 18, 2007 at 11:28:24PM -0700, Andrew Morton wrote:quoted
On Thu, 17 May 2007 06:47:53 +0800 Fengguang Wu [off-list ref] wrote:quoted
Introduce a new page flag: PG_readahead.Is there any way in which we can avoid adding a new page flag? We have the advantage that if the kernel very occasionally gets the wrong result for PageReadahead(page), nothing particularly bad will happen, so we can do racy things.quoted
From a quick peek, it appears that PG_readahead is only ever set againstnon-uptodate pages. If true we could perhaps exploit that: say, PageReadahead(page) == PG_referenced && !PG_uptodate?PG_uptodate will flip to 1 before the reader touches the page :(
OK.
However, it may be possible to share the same bit with PG_reclaim or PG_booked. Which one would be preferred?
I'd like PG_booked to go away too - I don't think we've put that under the microscope yet. If it remains then its scope will be "defined by the filesystem", so readahead shouldn't use it. PG_reclaim belongs to core VFS so that's much better. Let's not do anything ugly, slow or silly in there, but please do take a look, see if there is an opportunity here.