UMA caches draining

Konstantin Belousov kostikbel at gmail.com
Tue Jan 7 05:48:39 UTC 2014


On Tue, Jan 07, 2014 at 02:51:09AM +0200, Alexander Motin wrote:
> Hi.
> 
> I have some questions about memory allocation. At this moment our UMA 
> never returns freed memory back to the system until it is explicitly 
> asked by pageout daemon via uma_reclaim() call, that happens only when 
> system is quite low on memory. How does that coexist with buffer cache 
> and other consumers? Will, for example, buffer cache allocate buffers 
> and be functional when most of system's memory uselessly consumed by UMA 
> caches? Is there some design how that supposed to work?
Allocation of the pages which consitute a new buffer creates the pressure
and causes pagedaemon wakeup if amount of free pages is too low.  Look
at the vm_page_grab() call in allocbuf().  Also note that buffer cache
is not shrinked in response to the low memory events, and buffers pages
are excluded from the page daemon scans since pages are wired.

> 
> I've made an experimental patch for UMA 
> (http://people.freebsd.org/~mav/drain_unused.patch) to make it every 20 
> seconds return back to the system cached memory, unused for the last 20 
> seconds. Algorithm is quite simple and patch seems like working, but I 
> am not sure whether I am approaching problem from the right side. Any 
> thoughts?
> 
> -- 
> Alexander Motin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20140107/5414c070/attachment.sig>


More information about the freebsd-hackers mailing list