mm: memcontrol: Fix missing suffix of workingset_restore
Subsystems (4)
PATCH v6 1/2 mm: memcontrol: Fix missing suffix of workingset_restore
We forget to add the suffix to the workingset_restore string, so fix it. And also update the documentation of cgroup-v2.rst.
---
changelog in v6:
1. There is no version of v1-v5.
Documentation/admin-guide/cgroup-v2.rst | 25 ++++++++++++++++++------- mm/memcontrol.c | 4 ++-- 2 files changed, 20 insertions(+), 9 deletions(-)
Documentation/admin-guide/cgroup-v2.rst +18 -7
@@ -1324,15 +1324,26 @@ PAGE_SIZE multiple when read back. pgmajfault Number of major page faults incurred - workingset_refault - Number of refaults of previously evicted pages + workingset_refault_anon + Number of refaults of previously evicted anonymous pages. - workingset_activate - Number of refaulted pages that were immediately activated + workingset_refault_file + Number of refaults of previously evicted file pages. - workingset_restore - Number of restored pages which have been detected as an active - workingset before they got reclaimed. + workingset_activate_anon + Number of refaulted anonymous pages that were immediately + activated. + + workingset_activate_file + Number of refaulted file pages that were immediately activated. + + workingset_restore_anon + Number of restored anonymous pages which have been detected as + an active workingset before they got reclaimed. + + workingset_restore_file + Number of restored file pages which have been detected as an + active workingset before they got reclaimed. workingset_nodereclaim Number of times a shadow node has been reclaimed
mm/memcontrol.c +2 -2
@@ -1574,9 +1574,9 @@ static char *memory_stat_format(struct mem_cgroup *memcg) memcg_page_state(memcg, WORKINGSET_ACTIVATE_ANON));seq_buf_printf (&s,"workingset_activate_file %lu\n" ,memcg_page_state (memcg,WORKINGSET_ACTIVATE_FILE )); -seq_buf_printf (&s,"workingset_restore %lu\n" , +seq_buf_printf (&s,"workingset_restore_anon %lu\n" ,memcg_page_state (memcg,WORKINGSET_RESTORE_ANON )); -seq_buf_printf (&s,"workingset_restore %lu\n" , +seq_buf_printf (&s,"workingset_restore_file %lu\n" ,memcg_page_state (memcg,WORKINGSET_RESTORE_FILE ));seq_buf_printf (&s,"workingset_nodereclaim %lu\n" ,memcg_page_state (memcg,WORKINGSET_NODERECLAIM ));
Signature · 1 line
2.20.1
PATCH v6 2/2 mm: memcontrol: Add the missing numa_stat interface for cgroup v2
In the cgroup v1, we have a numa_stat interface. This is useful for providing visibility into the numa locality information within an memcg since the pages are allowed to be allocated from any physical node. One of the use cases is evaluating application performance by combining this information with the application's CPU allocation. But the cgroup v2 does not. So this patch adds the missing information.
---
changelog in v6:
1. Rework memory_stat_format() to reuse the same shared table of memory_stats.
2. Update documentation.
changelog in v5:
1. Fix small nits pointed out by Shakeel Butt
changelog in v4:
1. Fix some document problems pointed out by Randy Dunlap.
2. Remove memory_numa_stat_format() suggested by Shakeel Butt.
changelog in v3:
1. Fix compiler error on powerpc architecture reported by kernel test robot.
2. Fix a typo from "anno" to "anon".
changelog in v2:
1. Add memory.numa_stat interface in cgroup v2.
Documentation/admin-guide/cgroup-v2.rst | 69 +++++++--- mm/memcontrol.c | 170 +++++++++++++++--------- 2 files changed, 159 insertions(+), 80 deletions(-)
Documentation/admin-guide/cgroup-v2.rst +49 -20
@@ -1259,6 +1259,10 @@ PAGE_SIZE multiple when read back. can show up in the middle. Don't rely on items remaining in a fixed position; use the keys to look up specific values! + If the entry has no per-node counter(or not show in the + mempry.numa_stat). We use 'npn'(non-per-node) as the tag + to indicate that it will not show in the mempry.numa_stat. + anon Amount of memory used in anonymous mappings such as brk(), sbrk(), and mmap(MAP_ANONYMOUS)
@@ -1270,15 +1274,11 @@ PAGE_SIZE multiple when read back. kernel_stack Amount of memory allocated to kernel stacks. - slab - Amount of memory used for storing in-kernel data - structures. - - percpu + percpu(npn) Amount of memory used for storing per-cpu kernel data structures. - sock + sock(npn) Amount of memory used in network transmission buffers shmem
@@ -1318,11 +1318,9 @@ PAGE_SIZE multiple when read back. Part of "slab" that cannot be reclaimed on memory pressure. - pgfault - Total number of page faults incurred - - pgmajfault - Number of major page faults incurred + slab(npn) + Amount of memory used for storing in-kernel data + structures. workingset_refault_anon Number of refaults of previously evicted anonymous pages.
@@ -1348,37 +1346,68 @@ PAGE_SIZE multiple when read back. workingset_nodereclaim Number of times a shadow node has been reclaimed - pgrefill + pgfault(npn) + Total number of page faults incurred + + pgmajfault(npn) + Number of major page faults incurred + + pgrefill(npn) Amount of scanned pages (in an active LRU list) - pgscan + pgscan(npn) Amount of scanned pages (in an inactive LRU list) - pgsteal + pgsteal(npn) Amount of reclaimed pages - pgactivate + pgactivate(npn) Amount of pages moved to the active LRU list - pgdeactivate + pgdeactivate(npn) Amount of pages moved to the inactive LRU list - pglazyfree + pglazyfree(npn) Amount of pages postponed to be freed under memory pressure - pglazyfreed + pglazyfreed(npn) Amount of reclaimed lazyfree pages - thp_fault_alloc + thp_fault_alloc(npn) Number of transparent hugepages which were allocated to satisfy a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. - thp_collapse_alloc + thp_collapse_alloc(npn) Number of transparent hugepages which were allocated to allow collapsing an existing range of pages. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. + memory.numa_stat + A read-only nested-keyed file which exists on non-root cgroups. + + This breaks down the cgroup's memory footprint into different + types of memory, type-specific details, and other information + per node on the state of the memory management system. + + This is useful for providing visibility into the NUMA locality + information within an memcg since the pages are allowed to be + allocated from any physical node. One of the use case is evaluating + application performance by combining this information with the + application's CPU allocation. + + All memory amounts are in bytes. + + The output format of memory.numa_stat is:: + + type N0=<bytes in node 0> N1=<bytes in node 1> ... + + The entries are ordered to be human readable, and new entries + can show up in the middle. Don't rely on items remaining in a + fixed position; use the keys to look up specific values! + + The entries can refer to the memory.stat. + memory.swap.current A read-only single value file which exists on non-root cgroups.
mm/memcontrol.c +110 -60
202 lines not on this page · raw message
Signature · 1 line
2.20.1
Quoted 6 lines · Muchun Song
We forget to add the suffix to the
workingset_restorestring, so fix it. And also update the documentation ofcgroup-v2.rst.Fixes 170b04b7ae49 ("mm/workingset: prepare the workingset detection infrastructure for anon LRU")Signed-off-by Muchun Song <[email protected]>