Page cache patch - 2'nd version

Krzysztof Strasburger (strasbur@chkw386.ch.pwr.wroc.pl)
Mon, 30 Jun 97 11:36


Hi all!
After reading all comments about my previous (broken) patch and browsing the
source code (vmscan.c and filemap.c) I prepared new version of the patch,
which should improve releasing page cache pages (and id does it for me).
The philosophy is different than in previous patch and (in my hope) not
broken. Instead of setting the "referenced" bit (and making the page inviolable),
page->age is set to zero for unrefernced shared pages, making them good
candidates for swapping out.
Warning! My patch may interfere with buffer patches written by Werner Fink, so
if you use them and want to try my patch, install it better by hand. It is
trivial.
Regards - Krzysztof Strasburger

And here is the patch:

--- linux/mm/filemap.c.orig Tue May 6 07:37:23 1997
+++ linux/mm/filemap.c Mon Jun 30 10:40:15 1997
@@ -187,7 +187,10 @@

default:
/* more than one users: we can't throw it away */
- set_bit(PG_referenced, &page->flags);
+ /* Original: make the shared page inviolable. */
+ /* >set_bit(PG_referenced, &page->flags); */
+ /* Modified: make it good candidate for swapping out. */
+ page->age = 0;
/* fall through */
case 0:
/* nothing */