Message ID | 20200504153522.11553-1-laoar.shao@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v3] mm, memcg: add workingset_restore in memory.stat | expand |
Yafang Shao writes: >There's a new workingset counter introduced in commit 1899ad18c607 ("mm: >workingset: tell cache transitions from workingset thrashing"). With the >help of this counter we can know the workingset is transitioning or >thrashing. To leverage the benifit of this counter to memcg, we should >introduce it into memory.stat. Then we could know the workingset of the >workload inside a memcg better. Looks fine, thanks! Acked-by: Chris Down <chris@chrisdown.name>
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index bcc80269bb6a..5f12f203822e 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1329,6 +1329,10 @@ PAGE_SIZE multiple when read back. workingset_activate Number of refaulted pages that were immediately activated + workingset_restore + Number of restored pages which have been detected as an active + workingset before they got reclaimed. + workingset_nodereclaim Number of times a shadow node has been reclaimed diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 5beea03dd58a..0395e479995b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1451,6 +1451,8 @@ static char *memory_stat_format(struct mem_cgroup *memcg) memcg_page_state(memcg, WORKINGSET_REFAULT)); seq_buf_printf(&s, "workingset_activate %lu\n", memcg_page_state(memcg, WORKINGSET_ACTIVATE)); + seq_buf_printf(&s, "workingset_restore %lu\n", + memcg_page_state(memcg, WORKINGSET_RESTORE)); seq_buf_printf(&s, "workingset_nodereclaim %lu\n", memcg_page_state(memcg, WORKINGSET_NODERECLAIM));