linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] memcg: more sophisticated stats flushing
@ 2023-09-13  7:38 Yosry Ahmed
  2023-09-13  7:38 ` [PATCH 1/3] mm: memcg: change flush_next_time to flush_last_time Yosry Ahmed
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Yosry Ahmed @ 2023-09-13  7:38 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt,
	Muchun Song, Ivan Babrou, Tejun Heo, Michal Koutný,
	Waiman Long, kernel-team, Wei Xu, Greg Thelen, linux-mm, cgroups,
	linux-kernel, Yosry Ahmed

The current stats flushing approach is very simple. Everyone tries to
flush the entire tree, and only a single flusher is allowed. Concurrent
flushers just skip the flush completely. This approach has problems that
manifest in both flushing latency and stats accuracy (or freshness).
This series introduces a more sophisticated approach that aims to find a
better trade-off between accuracy and performance. Essentially we try to
get the best accuracy with the minimal amount of work done when possible
(fast path), and we fallback to more expensive or less accurate flushes
only when necessary. Details are in the commit message of patch 3, which
is really the core of this series.

Patches 1 & 2 are just cleanups with no functional change intended.

This series replaces v4 of "memcg: non-unified flushing for userspace
stats" series [1]. I did not send this as v5 as it completely deviates
from what that patchset is doing (but still trying to solve the same
problem). The approach followed in this series attempts to provide a
more generic framework for flushing for both userspace readers and
in-kernel flushers, to avoid having a lot of different flushing flavors.
It also benefits in-kernel flushers as well as userspace readers.

This series is a result of the discussions held in [1], and various
suggestions by Wei Xu <weixugc@google.com>.

[1] https://lore.kernel.org/lkml/20230831165611.2610118-1-yosryahmed@google.com/

Yosry Ahmed (3):
  mm: memcg: change flush_next_time to flush_last_time
  mm: memcg: rename stats_flush_threshold to stats_updates_order
  mm: memcg: optimize stats flushing for latency and accuracy

 include/linux/memcontrol.h |   4 +-
 mm/memcontrol.c            | 125 ++++++++++++++++++++++++++-----------
 mm/vmscan.c                |   2 +-
 mm/workingset.c            |   8 ++-
 4 files changed, 98 insertions(+), 41 deletions(-)

-- 
2.42.0.283.g2d96d420d3-goog



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-09-19  5:47 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-13  7:38 [PATCH 0/3] memcg: more sophisticated stats flushing Yosry Ahmed
2023-09-13  7:38 ` [PATCH 1/3] mm: memcg: change flush_next_time to flush_last_time Yosry Ahmed
2023-09-13  7:38 ` [PATCH 2/3] mm: memcg: rename stats_flush_threshold to stats_updates_order Yosry Ahmed
2023-09-13  7:38 ` [PATCH 3/3] mm: memcg: optimize stats flushing for latency and accuracy Yosry Ahmed
2023-09-13 15:37   ` Johannes Weiner
2023-09-13 16:26     ` Yosry Ahmed
2023-09-14 16:06       ` Johannes Weiner
2023-09-14 17:22         ` Yosry Ahmed
2023-09-14 17:26           ` Yosry Ahmed
2023-09-19  5:46           ` Yosry Ahmed
2023-09-14 17:19   ` Waiman Long
2023-09-14 17:23     ` Yosry Ahmed
2023-09-14 17:36       ` Waiman Long
2023-09-14 17:36   ` Shakeel Butt
2023-09-14 17:56     ` Yosry Ahmed
2023-09-14 22:58       ` Shakeel Butt
2023-09-14 23:30         ` Yosry Ahmed
2023-09-15  1:01           ` Shakeel Butt
2023-09-19  5:29             ` Yosry Ahmed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox