aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/controllers/memory.txt25
-rw-r--r--mm/memcontrol.c30
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
2925.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
2926. Hierarchy support 3176. Hierarchy support
293 318
294The memory controller supports a deep hierarchy and hierarchical accounting. 319The 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