On Wed, 23 Apr 2008 10:23:56 -0400
Venkatesh Srinivas <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> In Solaris, kmem_cache_create accepts a 'reclaim' callback, to be called
> under memory pressure; as far as I can see, Linux's allocator doesn't
> appear to have similar functionality.
> 
> I'd imagine this functionality would be useful for subsystems that hold
> caches or other resources that can be dropped safely under pressure.
> 
> Is there any reason why Linux doesn't have this callback? Would this be
> something reasonable for a newbie to work on adding?

Linux has something like it, but it has a different interface.

You'll want to take a look at register_shrinker() and friends in
mm/vmscan.c.  At reclaim time, the pageout code will call into
shrink_slab(), which iterates over the reclaim functions.

-- 
All rights reversed.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to