diff options
author | Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> | 2011-04-27 18:26:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-28 14:28:21 -0400 |
commit | a111c966a65e4b5d9c6fd2d8459978c1407077d5 (patch) | |
tree | 00deb8e67fff61c8e234ad048a7534f9129c618d /Documentation/cgroups | |
parent | 98909cf0d125eb0110afe92d0b419be7fa097f78 (diff) |
memcg: update documentation to describe usage_in_bytes
Since 569b846d ("memcg: coalesce uncharge during unmap/truncate"), we do
batched (delayed) uncharge at truncation/unmap. And since cdec2e42(memcg:
coalesce charging via percpu storage), we have percpu cache for
res_counter.
These changes improved performance of memory cgroup very much, but made
res_counter->usage usually have a bigger value than the actual value of
memory usage. So, *.usage_in_bytes, which show res_counter->usage, are
not desirable for precise values of memory(and swap) usage anymore.
Instead of removing these files completely(because we cannot know
res_counter->usage without them), this patch updates the meaning of those
files.
Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/cgroups')
-rw-r--r-- | Documentation/cgroups/memory.txt | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index b6ed61c95856..7c163477fcd8 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -52,8 +52,10 @@ Brief summary of control files. | |||
52 | tasks # attach a task(thread) and show list of threads | 52 | tasks # attach a task(thread) and show list of threads |
53 | cgroup.procs # show list of processes | 53 | cgroup.procs # show list of processes |
54 | cgroup.event_control # an interface for event_fd() | 54 | cgroup.event_control # an interface for event_fd() |
55 | memory.usage_in_bytes # show current memory(RSS+Cache) usage. | 55 | memory.usage_in_bytes # show current res_counter usage for memory |
56 | memory.memsw.usage_in_bytes # show current memory+Swap usage | 56 | (See 5.5 for details) |
57 | memory.memsw.usage_in_bytes # show current res_counter usage for memory+Swap | ||
58 | (See 5.5 for details) | ||
57 | memory.limit_in_bytes # set/show limit of memory usage | 59 | memory.limit_in_bytes # set/show limit of memory usage |
58 | memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage | 60 | memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage |
59 | memory.failcnt # show the number of memory usage hits limits | 61 | memory.failcnt # show the number of memory usage hits limits |
@@ -453,6 +455,15 @@ memory under it will be reclaimed. | |||
453 | You can reset failcnt by writing 0 to failcnt file. | 455 | You can reset failcnt by writing 0 to failcnt file. |
454 | # echo 0 > .../memory.failcnt | 456 | # echo 0 > .../memory.failcnt |
455 | 457 | ||
458 | 5.5 usage_in_bytes | ||
459 | |||
460 | For efficiency, as other kernel components, memory cgroup uses some optimization | ||
461 | to avoid unnecessary cacheline false sharing. usage_in_bytes is affected by the | ||
462 | method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz | ||
463 | value for efficient access. (Of course, when necessary, it's synchronized.) | ||
464 | If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) | ||
465 | value in memory.stat(see 5.2). | ||
466 | |||
456 | 6. Hierarchy support | 467 | 6. Hierarchy support |
457 | 468 | ||
458 | The memory controller supports a deep hierarchy and hierarchical accounting. | 469 | The memory controller supports a deep hierarchy and hierarchical accounting. |