Commit c863d835 authored by Bharata B Rao's avatar Bharata B Rao Committed by Linus Torvalds

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: default avatarBharata B Rao <bharata@linux.vnet.ibm.com>
Acked-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e930438c
...@@ -6,15 +6,14 @@ used here with the memory controller that is used in hardware. ...@@ -6,15 +6,14 @@ used here with the memory controller that is used in hardware.
Salient features Salient features
a. Enable control of both RSS (mapped) and Page Cache (unmapped) pages a. Enable control of Anonymous, Page Cache (mapped and unmapped) and
Swap Cache memory pages.
b. The infrastructure allows easy addition of other types of memory to control b. The infrastructure allows easy addition of other types of memory to control
c. Provides *zero overhead* for non memory controller users c. Provides *zero overhead* for non memory controller users
d. Provides a double LRU: global memory pressure causes reclaim from the d. Provides a double LRU: global memory pressure causes reclaim from the
global LRU; a cgroup on hitting a limit, reclaims from the per global LRU; a cgroup on hitting a limit, reclaims from the per
cgroup LRU cgroup LRU
NOTE: Swap Cache (unmapped) is not accounted now.
Benefits and Purpose of the memory controller Benefits and Purpose of the memory controller
The memory controller isolates the memory behaviour of a group of tasks The memory controller isolates the memory behaviour of a group of tasks
...@@ -290,34 +289,44 @@ will be charged as a new owner of it. ...@@ -290,34 +289,44 @@ will be charged as a new owner of it.
moved to the parent. If you want to avoid that, force_empty will be useful. moved to the parent. If you want to avoid that, force_empty will be useful.
5.2 stat file 5.2 stat file
memory.stat file includes following statistics (now)
cache - # of pages from page-cache and shmem. memory.stat file includes following statistics
rss - # of pages from anonymous memory.
pgpgin - # of event of charging cache - # of bytes of page cache memory.
pgpgout - # of event of uncharging rss - # of bytes of anonymous and swap cache memory.
active_anon - # of pages on active lru of anon, shmem. pgpgin - # of pages paged in (equivalent to # of charging events).
inactive_anon - # of pages on active lru of anon, shmem pgpgout - # of pages paged out (equivalent to # of uncharging events).
active_file - # of pages on active lru of file-cache active_anon - # of bytes of anonymous and swap cache memory on active
inactive_file - # of pages on inactive lru of file cache lru list.
unevictable - # of pages cannot be reclaimed.(mlocked etc) inactive_anon - # of bytes of anonymous memory and swap cache memory on
inactive lru list.
Below is depend on CONFIG_DEBUG_VM. active_file - # of bytes of file-backed memory on active lru list.
inactive_ratio - VM internal parameter. (see mm/page_alloc.c) inactive_file - # of bytes of file-backed memory on inactive lru list.
recent_rotated_anon - VM internal parameter. (see mm/vmscan.c) unevictable - # of bytes of memory that cannot be reclaimed (mlocked etc).
recent_rotated_file - VM internal parameter. (see mm/vmscan.c)
recent_scanned_anon - VM internal parameter. (see mm/vmscan.c) The following additional stats are dependent on CONFIG_DEBUG_VM.
recent_scanned_file - VM internal parameter. (see mm/vmscan.c)
inactive_ratio - VM internal parameter. (see mm/page_alloc.c)
Memo: recent_rotated_anon - VM internal parameter. (see mm/vmscan.c)
recent_rotated_file - VM internal parameter. (see mm/vmscan.c)
recent_scanned_anon - VM internal parameter. (see mm/vmscan.c)
recent_scanned_file - VM internal parameter. (see mm/vmscan.c)
Memo:
recent_rotated means recent frequency of lru rotation. recent_rotated means recent frequency of lru rotation.
recent_scanned means recent # of scans to lru. recent_scanned means recent # of scans to lru.
showing for better debug please see the code for meanings. showing for better debug please see the code for meanings.
Note:
Only anonymous and swap cache memory is listed as part of 'rss' stat.
This should not be confused with the true 'resident set size' or the
amount of physical memory used by the cgroup. Per-cgroup rss
accounting is not done yet.
5.3 swappiness 5.3 swappiness
Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only.
Following cgroup's swapiness can't be changed. Following cgroups' swapiness can't be changed.
- root cgroup (uses /proc/sys/vm/swappiness). - root cgroup (uses /proc/sys/vm/swappiness).
- a cgroup which uses hierarchy and it has child cgroup. - a cgroup which uses hierarchy and it has child cgroup.
- a cgroup which uses hierarchy and not the root of hierarchy. - a cgroup which uses hierarchy and not the root of hierarchy.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment