[lkml]   [2001]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] filemap.c fixes
Hi Linus,

here are a filemap.c fix and a slight addition:

1) __find_page_nolock should only set the referenced bit
on an active page, otherwise a number of subsequent
reads from the same page within one page scan interval
can SEVERELY mess up page aging to the disadvantage of
the other pages in the system ...
just setting the referenced bit on the page makes the
aging a lot fairer

2) in drop_behind() we first increase the page age and
will then proceed to deactivate the page again; better
have a simpler help function for this ... note that this
help function could also be used for eg. ->writepage()
write clustering code


Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

Send all your spam to (spam digging piggy)

--- linux-2.4.5-pre1/mm/filemap.c.orig Mon May 14 00:55:53 2001
+++ linux-2.4.5-pre1/mm/filemap.c Mon May 14 00:56:03 2001
@@ -299,13 +299,14 @@
- * Touching the page may move it to the active list.
- * If we end up with too few inactive pages, we wake
- * up kswapd.
+ * Mark the page referenced, moving inactive pages to the
+ * active list.
- age_page_up(page);
- if (inactive_shortage() > inactive_target / 2 && free_shortage())
- wakeup_kswapd();
+ if (!PageActive(page))
+ activate_page(page);
+ else
+ SetPageReferenced(page);
return page;
@@ -783,8 +784,7 @@
while (--index >= start) {
- hash = page_hash(mapping, index);
- page = __find_page_nolock(mapping, index, *hash);
+ page = __find_page_simple(mapping, index);
if (!page)
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 12:52    [W:0.217 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site