aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2009-01-07 21:08:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:08 -0500
commit7f016ee8b6a9a43f768e6252021f169abec4fa1f (patch)
tree68498191489e051a23da0d39de2b0257714e58b0 /mm
parent9439c1c95b5c25b8031b2a7eb7e1590eb84be7f5 (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>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index b8c1e5acc25..af28e128b74 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