[lkml]   [2001]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject2.4.10 does not set accessed bit for readahead pages

Hi people,

I was taking a closer look at 2.4.10's mark_page_accessed() changes
(unfortunately just now, I've been quite busy lately with other issues)
and I noticed that readahead pages are not having their referenced bit set
when they are found in cache.

page_cache_read() (called by generic_file_readahead()), will simply do a
pagecache lookup and return in case the (being readahead) page is already

I've done some experiments in the past trying to use a new GFP_ flag for
allocation of readahead pages. This new GFP flag was the indicator to
__alloc_pages() that it should fail very easily (so, in theory, we would
not spend time on page reclaiming for readahead, which is simply a guess).

With the above working, I got much slower results: It showed me in
practice, with real numbers, that the additional page reclaiming work for
readahead pages was worth due to the avoided disk seeks.

So I think it makes quite some sense to avoid readahead pages from being
removed from the cache easily, by calling mark_page_accessed() at

--- filemap.c.orig Fri Sep 28 16:43:57 2001
+++ filemap.c Fri Sep 28 16:44:56 2001
@@ -670,8 +670,10 @@
page = __find_page_nolock(mapping, offset, *hash);
- if (page)
+ if (page) {
+ mark_page_accessed(page);
return 0;
+ }

page = page_cache_alloc(mapping);
if (!page)

NOTE: I'm saying that it is _bad_ to throw away readahead pages easily
because I've seen it in practice. I'll try to test this in real practice
again soon (not this week) to make sure.

Comments ?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.032 / U:1.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site