Re: unexpected paging during large file reads in 2.1.127

David J. Fred (djf@ic.net)
Fri, 13 Nov 1998 02:27:41 -0500


>
>Page cache is definitely too aggressive on recent kernels. I developed
>a small patch that avoids excessive swapouts. It helps kswapd to have
>less trouble reusing pages from page cache.
>
>Index: 126.2/mm/filemap.c
>[...]
>+ /* Age named pages aggresively, so page cache
>+ * doesn't grow too fast. -zcalusic
>+ */
>+ age_page(page);
>+ age_page(page);
>
>Try that and report results, please!

While it didn't solve the problem completely it definitely helped.
With the extra age_page() calls I didn't see anything resembling the
thrashing I saw before. However very regularly, every 15-18 seconds
or so, I still got little bursts of swapouts. It was nothing that
impacted the system overall but it still did mildly interfere with
uniform read performance.

>Other, more drastic thing to do is to completely remove the if clause
>above. That defeats page aging completely and returns you to 2.0
>behaviour. In that case, it would probably be good to return two
>constants in shrink_mmap() (mm/filemap.c) to their old smaller values:
>
> count_max = (limit<<2) >> (priority>>1);
> count_min = (limit<<2) >> (priority);
>
>Just change both (limit<<2) to (limit<<1).

This "more drastic" method cleared up the swapping during file reads,
but from what you say is apparently a regression of sorts.

I guess my main concern was that nobody had noticed this behavior. It
sounds like solutions are being pondered, which is heartening.
Incidentally, if you'd like me to test any other proposed solutions on
a relatively large memory (256M) machine, just let me know.

Regards,

David

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/