diff options
author | Yosry Ahmed <[email protected]> | 2023-09-22 17:57:40 +0000 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-10-18 14:34:12 -0700 |
commit | 7bd5bc3ce9632aefd0eed33a19212a2e55c0f873 (patch) | |
tree | 2584a661fa5e51523ab5a2be43e1d8fa055fdfbd /tools/testing/radix-tree/linux.c | |
parent | ff841a06c844b0556b434d67cfc43f4fda56ae7b (diff) |
mm: memcg: normalize the value passed into memcg_rstat_updated()
memcg_rstat_updated() uses the value of the state update to keep track of
the magnitude of pending updates, so that we only do a stats flush when
it's worth the work. Most values passed into memcg_rstat_updated() are in
pages, however, a few of them are actually in bytes or KBs.
To put this into perspective, a 512 byte slab allocation today would look
the same as allocating 512 pages. This may result in premature flushes,
which means unnecessary work and latency.
Normalize all the state values passed into memcg_rstat_updated() to pages.
Round up non-zero sub-page to 1 page, because memcg_rstat_updated()
ignores 0 page updates.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 5b3be698a872 ("memcg: better bounds on the memcg stats updates")
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