]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: unify memcg stat flushing
authorShakeel Butt <shakeelb@google.com>
Fri, 5 Nov 2021 20:37:34 +0000 (13:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Nov 2021 20:30:35 +0000 (13:30 -0700)
commitbf69ac77515972e9a18941cf30179850f85f5800
tree3368f02cba8bfaa7779a46e7c83c8866494b75cb
parentacb7cc0478747f4bc7ddc0f9dece46ba95dfa2fd
memcg: unify memcg stat flushing

The memcg stats can be flushed in multiple context and potentially in
parallel too.  For example multiple parallel user space readers for
memcg stats will contend on the rstat locks with each other.  There is
no need for that.  We just need one flusher and everyone else can
benefit.

In addition after 8604faa3af29 ("memcg: infrastructure to flush memcg
stats") the kernel periodically flush the memcg stats from the root, so,
the other flushers will potentially have much less work to do.

Link: https://lkml.kernel.org/r/20211001190040.48086-2-shakeelb@google.com
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: "Michal Koutný" <mkoutny@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c