diff options
| author | Yosry Ahmed <[email protected]> | 2023-09-22 17:57:39 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-10-18 21:34:12 +0000 |
| commit | ff841a06c844b0556b434d67cfc43f4fda56ae7b (patch) | |
| tree | 4918030b28626462338297bcbd6f3b944cb7ddaf /tools/testing/radix-tree/linux.c | |
| parent | mm/memcg: annotate struct mem_cgroup_threshold_ary with __counted_by (diff) | |
| download | kernel-ff841a06c844b0556b434d67cfc43f4fda56ae7b.tar.gz kernel-ff841a06c844b0556b434d67cfc43f4fda56ae7b.zip | |
mm: memcg: refactor page state unit helpers
Patch series "mm: memcg: fix tracking of pending stats updates values", v2.
While working on adjacent code [1], I realized that the values passed into
memcg_rstat_updated() to keep track of the magnitude of pending updates is
consistent. It is mostly in pages, but sometimes it can be in bytes or
KBs. Fix that.
Patch 1 reworks memcg_page_state_unit() so that we can reuse it in patch 2
to check and normalize the units of state updates.
[1]https://lore.kernel.org/lkml/[email protected]/
This patch (of 2):
memcg_page_state_unit() is currently used to identify the unit of a memcg
state item so that all stats in memory.stat are in bytes. However, it
lies about the units of WORKINGSET_* stats. These stats actually
represent pages, but we present them to userspace as a scalar number of
events. In retrospect, maybe those stats should have been memcg "events"
rather than memcg "state".
In preparation for using memcg_page_state_unit() for other purposes that
need to know the truthful units of different stat items, break it down
into two helpers:
- memcg_page_state_unit() retuns the actual unit of the item.
- memcg_page_state_output_unit() returns the unit used for output.
Use the latter instead of the former in memcg_page_state_output() and
lruvec_page_state_output(). While we are at it, let's show cgroup v1 some
love and add memcg_page_state_local_output() for consistency.
No functional change intended.
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Yosry Ahmed <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Michal Koutný <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Shakeel Butt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/testing/radix-tree/linux.c')
0 files changed, 0 insertions, 0 deletions
