Re: Page cache patch - 2'nd version

Dr. Werner Fink (werner@suse.de)
Mon, 30 Jun 1997 16:24:41 +0200


> 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.

Simply appling your patch should work. And IMHO you've found a solution. I've
applied you patch over my patched kernel version ... after compiling and
testing the system show's a real performance win on high _and_ low system load.
You maybe found it's a (the?) real solution: Why shrink_mmap() should reference
a page which is not used by shrink_mmap() it's self?

> Regards - Krzysztof Strasburger

Running your patch

Werner

>
> 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 */
>