Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

memcg: fix documentation

The description about various statistics from memory.stat is not accurate
and confusing at times.

Correct this along with a few other minor cleanups.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Bharata B Rao and committed by
Linus Torvalds
c863d835 e930438c

+30 -21
+30 -21
Documentation/cgroups/memory.txt
··· 6 6 7 7 Salient features 8 8 9 - a. Enable control of both RSS (mapped) and Page Cache (unmapped) pages 9 + a. Enable control of Anonymous, Page Cache (mapped and unmapped) and 10 + Swap Cache memory pages. 10 11 b. The infrastructure allows easy addition of other types of memory to control 11 12 c. Provides *zero overhead* for non memory controller users 12 13 d. Provides a double LRU: global memory pressure causes reclaim from the 13 14 global LRU; a cgroup on hitting a limit, reclaims from the per 14 15 cgroup LRU 15 - 16 - NOTE: Swap Cache (unmapped) is not accounted now. 17 16 18 17 Benefits and Purpose of the memory controller 19 18 ··· 289 290 moved to the parent. If you want to avoid that, force_empty will be useful. 290 291 291 292 5.2 stat file 292 - memory.stat file includes following statistics (now) 293 - cache - # of pages from page-cache and shmem. 294 - rss - # of pages from anonymous memory. 295 - pgpgin - # of event of charging 296 - pgpgout - # of event of uncharging 297 - active_anon - # of pages on active lru of anon, shmem. 298 - inactive_anon - # of pages on active lru of anon, shmem 299 - active_file - # of pages on active lru of file-cache 300 - inactive_file - # of pages on inactive lru of file cache 301 - unevictable - # of pages cannot be reclaimed.(mlocked etc) 302 293 303 - Below is depend on CONFIG_DEBUG_VM. 304 - inactive_ratio - VM internal parameter. (see mm/page_alloc.c) 305 - recent_rotated_anon - VM internal parameter. (see mm/vmscan.c) 306 - recent_rotated_file - VM internal parameter. (see mm/vmscan.c) 307 - recent_scanned_anon - VM internal parameter. (see mm/vmscan.c) 308 - recent_scanned_file - VM internal parameter. (see mm/vmscan.c) 294 + memory.stat file includes following statistics 309 295 310 - Memo: 296 + cache - # of bytes of page cache memory. 297 + rss - # of bytes of anonymous and swap cache memory. 298 + pgpgin - # of pages paged in (equivalent to # of charging events). 299 + pgpgout - # of pages paged out (equivalent to # of uncharging events). 300 + active_anon - # of bytes of anonymous and swap cache memory on active 301 + lru list. 302 + inactive_anon - # of bytes of anonymous memory and swap cache memory on 303 + inactive lru list. 304 + active_file - # of bytes of file-backed memory on active lru list. 305 + inactive_file - # of bytes of file-backed memory on inactive lru list. 306 + unevictable - # of bytes of memory that cannot be reclaimed (mlocked etc). 307 + 308 + The following additional stats are dependent on CONFIG_DEBUG_VM. 309 + 310 + inactive_ratio - VM internal parameter. (see mm/page_alloc.c) 311 + recent_rotated_anon - VM internal parameter. (see mm/vmscan.c) 312 + recent_rotated_file - VM internal parameter. (see mm/vmscan.c) 313 + recent_scanned_anon - VM internal parameter. (see mm/vmscan.c) 314 + recent_scanned_file - VM internal parameter. (see mm/vmscan.c) 315 + 316 + Memo: 311 317 recent_rotated means recent frequency of lru rotation. 312 318 recent_scanned means recent # of scans to lru. 313 319 showing for better debug please see the code for meanings. 314 320 321 + Note: 322 + Only anonymous and swap cache memory is listed as part of 'rss' stat. 323 + This should not be confused with the true 'resident set size' or the 324 + amount of physical memory used by the cgroup. Per-cgroup rss 325 + accounting is not done yet. 315 326 316 327 5.3 swappiness 317 328 Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. 318 329 319 - Following cgroup's swapiness can't be changed. 330 + Following cgroups' swapiness can't be changed. 320 331 - root cgroup (uses /proc/sys/vm/swappiness). 321 332 - a cgroup which uses hierarchy and it has child cgroup. 322 333 - a cgroup which uses hierarchy and not the root of hierarchy.