The notion of a "shrinker" in vmscan.c is interesting. I ran across it while working out how inodes are destroyed (one way is using prune_icache, which ends up being called in such a way). struct shrinker { shrinker_t shrinker; struct list_head list; int seeks; /* seeks to recreate an obj */ long nr; /* objs pending delete */ }; typedef int (*shrinker_t)(int nr_to_scan, unsigned int gfp_mask); Scans nr_to_scan objects, freeing them if possible. Returns number of objects left in the cache after shrinking. VM may call with nr_to_scan == 0 just to find out number of objects. "list" field links shrinkers into global shrinker_list. set_shrinker(int seeks, shrinker_t theshrinker); install a "shrinker" on the shrinker list. The number of seeks is an estimate of the number of disk seeks that will be required to free each object. Currently is used for dcache, inodes, a few other things. Could we use something like this e.g. for deciding when to free things like nfsv4 server-side state or gss contexts, or would that be overkill?