Re: [PATCH] Caches that shrink automatically

From: Linus Torvalds (torvalds@transmeta.com)
Date: Sun Aug 04 2002 - 13:50:39 EST


On Sun, 4 Aug 2002, Rik van Riel wrote:
>
> Linus has indicated that he would like to have it page based,
> but implementation issues point towards letting the subcache
> manage its objects by itself ;)

The two are not mutually incompatible.

I think we've all seen that non-global shrinking just doesn't work very
well, because one cache that grows too large will end up asking everybody
else to shrink, even if a global shrinking policy would have realized that
the memory pressure is due to that one overly large cache. The resulting
balancing problems are "interesting".

Being purely page-based, together with support for the sub-caches knowing
about the page-based aging, should be fine.

In particular, it is useless for the sub-caches to try to maintain their
own LRU lists and their own accessed bits. But that doesn't mean that they
can _act_ as if they updated their own accessed bits, while really just
telling the page-based thing that that page is active.

This is what the buffer cache has been doing for the last two years, ie
"touch_buffer()" actually ends up touching the page. Which seems to be
working quite well.

                Linus

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



This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:25 EST