Re: [PATCH] Caches that shrink automatically

From: Hans Reiser (
Date: Sun Aug 04 2002 - 06:30:56 EST

How do you ensure that caches have their (internal) aging hands pushed
at a speed that is proportional to their memory usage, or is your design
susceptible to all the usual complaints the unified memory manager crowd
has about separate caches?


Andreas Gruenbacher wrote:

>Currently there is no way for modules to define dynamically sized caches that
>shrink upon memory pressure. We need this for implementing Extended Attribute
>caches on ext2, ext3, and ReiserFS. Other caches could also make use of the
>same mechanism (e.g., nfsd's permission cache, dcache, icache, dqache).
>I propose this patch, which adds the register_cache() and unregister_cache()
>functions. They allow to register a callback which is invoked on memory
>pressure. This callback shall then try to free some memory; the parameters
>and semantics are similar to the other shrink functions in mm/vmscan.c.
> Andreas Gruenbacher SuSE Linux AG
> Deutschherrnstr. 15-19
> D-90429 Nuernberg, Germany


- 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

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