aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups/memory.txt
diff options
context:
space:
mode:
authorYing Han <yinghan@google.com>2013-11-12 18:07:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 22:09:06 -0500
commit071aee138410210e3764f3ae8d37ef46dc6d3b42 (patch)
tree23149ad428053f9ef658cdd57c8b479c318a7ccb /Documentation/cgroups/memory.txt
parent25485de6e90ef1684c55a203988fad5eab7a45d6 (diff)
memcg: support hierarchical memory.numa_stats
The memory.numa_stat file was not hierarchical. Memory charged to the children was not shown in parent's numa_stat. This change adds the "hierarchical_" stats to the existing stats. The new hierarchical stats include the sum of all children's values in addition to the value of the memcg. Tested: Create cgroup a, a/b and run workload under b. The values of b are included in the "hierarchical_*" under a. $ cd /sys/fs/cgroup $ echo 1 > memory.use_hierarchy $ mkdir a a/b Run workload in a/b: $ (echo $BASHPID >> a/b/cgroup.procs && cat /some/file && bash) & The hierarchical_ fields in parent (a) show use of workload in a/b: $ cat a/memory.numa_stat total=0 N0=0 N1=0 N2=0 N3=0 file=0 N0=0 N1=0 N2=0 N3=0 anon=0 N0=0 N1=0 N2=0 N3=0 unevictable=0 N0=0 N1=0 N2=0 N3=0 hierarchical_total=908 N0=552 N1=317 N2=39 N3=0 hierarchical_file=850 N0=549 N1=301 N2=0 N3=0 hierarchical_anon=58 N0=3 N1=16 N2=39 N3=0 hierarchical_unevictable=0 N0=0 N1=0 N2=0 N3=0 $ cat a/b/memory.numa_stat total=908 N0=552 N1=317 N2=39 N3=0 file=850 N0=549 N1=301 N2=0 N3=0 anon=58 N0=3 N1=16 N2=39 N3=0 unevictable=0 N0=0 N1=0 N2=0 N3=0 hierarchical_total=908 N0=552 N1=317 N2=39 N3=0 hierarchical_file=850 N0=549 N1=301 N2=0 N3=0 hierarchical_anon=58 N0=3 N1=16 N2=39 N3=0 hierarchical_unevictable=0 N0=0 N1=0 N2=0 N3=0 Signed-off-by: Ying Han <yinghan@google.com> Signed-off-by: Greg Thelen <gthelen@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/cgroups/memory.txt')
-rw-r--r--Documentation/cgroups/memory.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 8af4ad121828..e2bc132608fd 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -573,15 +573,19 @@ an memcg since the pages are allowed to be allocated from any physical
573node. One of the use cases is evaluating application performance by 573node. One of the use cases is evaluating application performance by
574combining this information with the application's CPU allocation. 574combining this information with the application's CPU allocation.
575 575
576We export "total", "file", "anon" and "unevictable" pages per-node for 576Each memcg's numa_stat file includes "total", "file", "anon" and "unevictable"
577each memcg. The ouput format of memory.numa_stat is: 577per-node page counts including "hierarchical_<counter>" which sums up all
578hierarchical children's values in addition to the memcg's own value.
579
580The ouput format of memory.numa_stat is:
578 581
579total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ... 582total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ...
580file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ... 583file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ...
581anon=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ... 584anon=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ...
582unevictable=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ... 585unevictable=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ...
586hierarchical_<counter>=<counter pages> N0=<node 0 pages> N1=<node 1 pages> ...
583 587
584And we have total = file + anon + unevictable. 588The "total" count is sum of file + anon + unevictable.
585 589
5866. Hierarchy support 5906. Hierarchy support
587 591