Re: kmem_cache_create reclaim callback?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 23 Apr 2008 10:23:56 -0400
Venkatesh Srinivas <me@xxxxxxxxxxx> 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 ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux