diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2009-01-07 21:08:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 11:31:08 -0500 |
commit | 7f016ee8b6a9a43f768e6252021f169abec4fa1f (patch) | |
tree | 68498191489e051a23da0d39de2b0257714e58b0 | |
parent | 9439c1c95b5c25b8031b2a7eb7e1590eb84be7f5 (diff) |
memcg: show reclaim stat
Add the following four fields to memory.stat file:
- inactive_ratio
- recent_rotated_anon
- recent_rotated_file
- recent_scanned_anon
- recent_scanned_file
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | Documentation/controllers/memory.txt | 25 | ||||
-rw-r--r-- | mm/memcontrol.c | 30 |
2 files changed, 55 insertions, 0 deletions
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 09e1c737d285..d71745cc2f00 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt | |||
@@ -289,6 +289,31 @@ will be charged as a new owner of it. | |||
289 | Because rmdir() moves all pages to parent, some out-of-use page caches can be | 289 | Because rmdir() moves all pages to parent, some out-of-use page caches can be |
290 | moved to the parent. If you want to avoid that, force_empty will be useful. | 290 | moved to the parent. If you want to avoid that, force_empty will be useful. |
291 | 291 | ||
292 | 5.2 stat file | ||
293 | memory.stat file includes following statistics (now) | ||
294 | cache - # of pages from page-cache and shmem. | ||
295 | rss - # of pages from anonymous memory. | ||
296 | pgpgin - # of event of charging | ||
297 | pgpgout - # of event of uncharging | ||
298 | active_anon - # of pages on active lru of anon, shmem. | ||
299 | inactive_anon - # of pages on active lru of anon, shmem | ||
300 | active_file - # of pages on active lru of file-cache | ||
301 | inactive_file - # of pages on inactive lru of file cache | ||
302 | unevictable - # of pages cannot be reclaimed.(mlocked etc) | ||
303 | |||
304 | Below is depend on CONFIG_DEBUG_VM. | ||
305 | inactive_ratio - VM inernal parameter. (see mm/page_alloc.c) | ||
306 | recent_rotated_anon - VM internal parameter. (see mm/vmscan.c) | ||
307 | recent_rotated_file - VM internal parameter. (see mm/vmscan.c) | ||
308 | recent_scanned_anon - VM internal parameter. (see mm/vmscan.c) | ||
309 | recent_scanned_file - VM internal parameter. (see mm/vmscan.c) | ||
310 | |||
311 | Memo: | ||
312 | recent_rotated means recent frequency of lru rotation. | ||
313 | recent_scanned means recent # of scans to lru. | ||
314 | showing for better debug please see the code for meanings. | ||
315 | |||
316 | |||
292 | 6. Hierarchy support | 317 | 6. Hierarchy support |
293 | 318 | ||
294 | The memory controller supports a deep hierarchy and hierarchical accounting. | 319 | The memory controller supports a deep hierarchy and hierarchical accounting. |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b8c1e5acc25a..af28e128b749 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1816,6 +1816,36 @@ static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft, | |||
1816 | cb->fill(cb, "unevictable", unevictable * PAGE_SIZE); | 1816 | cb->fill(cb, "unevictable", unevictable * PAGE_SIZE); |
1817 | 1817 | ||
1818 | } | 1818 | } |
1819 | |||
1820 | #ifdef CONFIG_DEBUG_VM | ||
1821 | cb->fill(cb, "inactive_ratio", mem_cont->inactive_ratio); | ||
1822 | |||
1823 | { | ||
1824 | int nid, zid; | ||
1825 | struct mem_cgroup_per_zone *mz; | ||
1826 | unsigned long recent_rotated[2] = {0, 0}; | ||
1827 | unsigned long recent_scanned[2] = {0, 0}; | ||
1828 | |||
1829 | for_each_online_node(nid) | ||
1830 | for (zid = 0; zid < MAX_NR_ZONES; zid++) { | ||
1831 | mz = mem_cgroup_zoneinfo(mem_cont, nid, zid); | ||
1832 | |||
1833 | recent_rotated[0] += | ||
1834 | mz->reclaim_stat.recent_rotated[0]; | ||
1835 | recent_rotated[1] += | ||
1836 | mz->reclaim_stat.recent_rotated[1]; | ||
1837 | recent_scanned[0] += | ||
1838 | mz->reclaim_stat.recent_scanned[0]; | ||
1839 | recent_scanned[1] += | ||
1840 | mz->reclaim_stat.recent_scanned[1]; | ||
1841 | } | ||
1842 | cb->fill(cb, "recent_rotated_anon", recent_rotated[0]); | ||
1843 | cb->fill(cb, "recent_rotated_file", recent_rotated[1]); | ||
1844 | cb->fill(cb, "recent_scanned_anon", recent_scanned[0]); | ||
1845 | cb->fill(cb, "recent_scanned_file", recent_scanned[1]); | ||
1846 | } | ||
1847 | #endif | ||
1848 | |||
1819 | return 0; | 1849 | return 0; |
1820 | } | 1850 | } |
1821 | 1851 | ||