LWN.net Logo

Better active/inactive list balancing

Better active/inactive list balancing

Posted May 3, 2012 20:49 UTC (Thu) by geuder (subscriber, #62854)
Parent article: Better active/inactive list balancing

Thanks for the clear introduction to the LRU implementation.

I'm not a kernel hacker, but still curious enough to look under the hood of my machine sometimes (especially in those moments when I'm convinced that a reasonable software cannot be so slow to complete the task in question...)

To look into memory management there is /proc/kpageflags, displayed in human readable format by the page-types tool (recently moved from Documentation/vm to tools in the kernel tree).

If I guess correctly the size of the active list can be shown using
"page-types -b active"

I further guess the size of the inactive list can be shown using
"page-types -b lru,~active,~unevictable"

(the article simplified from the fact that there are really 3 list nowadays, unevictable being the 3rd one. It's well described under Documentation/vm/unevictable-lru.txt)

However, when running these commands on 2 machines in this moment I get:

- active 168 MB, inactive 259 MB on a 512 MB system
- active 1366 MB, inactive 971 MB on a 4 GB system

So either my guesses about the options to use are incorrect or there is no such limitation as inactive > active.

All hints welcome!


(Log in to post comments)

Better active/inactive list balancing

Posted May 3, 2012 20:56 UTC (Thu) by geuder (subscriber, #62854) [Link]

Commenting myself:

> It's well described under Documentation/vm/unevictable-lru.txt)

Well, the advanced concept is well described in the kernel documentation. But it did never really make sense to me until I got the basics explained today in the article.

Better active/inactive list balancing

Posted May 4, 2012 8:40 UTC (Fri) by hnaz (subscriber, #67104) [Link]

You can get the list sizes more easily:

nassau:~$ grep active /proc/vmstat
nr_inactive_anon 267
nr_active_anon 392461
nr_inactive_file 258286
nr_active_file 416048

Or even more detailed from /proc/zoneinfo, as each memory zone has its own set of lists.

The inactive > active rule is only enforced during reclaim, we don't mind the list sizes on idle systems.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds