linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET] mm, memcontrol: Make cgroup_rstat available to controllers
@ 2018-03-24 16:08 Tejun Heo
  2018-03-24 16:08 ` [PATCH 1/3] mm: memcontrol: Use cgroup_rstat for event accounting Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tejun Heo @ 2018-03-24 16:08 UTC (permalink / raw)
  To: hannes, mhocko, vdavydov.dev
  Cc: guro, riel, akpm, linux-kernel, kernel-team, cgroups, linux-mm

Hello,

Since a983b5ebee57 ("mm: memcontrol: fix excessive complexity in
memory.stat reporting"), memcg uses percpu batch-overflowing for all
stat accounting.  While the propagation delay is okay for statistics,
it doesn't work for events.  If a notification for an event is sent
out, the relevant counter must reflect the event when read afterwards.
With the percpu batching, it's easy to miss, for example, an oom or
oom_kill event because it's still buffered in one of the percpu
counters.

cgroup already has a mechanism to efficiently handle hierarchical
statistics in a scalable manner, cgroup_rstat, and it now can be used
by controllers.

This patchset addresses the forementioned problem by converting event
accounting to cgroup_rstat.  While the stat part isn't broken, it's
also converted for consistency and a few other benefits.  Also, while
trying to convert lruvec_stat, I found out that it has no users.
Remove it too (not sure whether it's needed for some non-obvious
reasons tho).

 0001-mm-memcontrol-Use-cgroup_rstat-for-event-accounting.patch
 0002-mm-memcontrol-Use-cgroup_rstat-for-stat-accounting.patch
 0003-mm-memcontrol-Remove-lruvec_stat.patch

This patchset is on top of the "cgroup/for-4.17: Make cgroup_rstat
available to controllers" patchset[1] and also available in the
following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-cgroup_rstat

diffstat follows.

 include/linux/memcontrol.h |  131 ++++++++++++------------
 mm/memcontrol.c            |  238 ++++++++++++++++++++-------------------------
 mm/vmscan.c                |    4 
 3 files changed, 180 insertions(+), 193 deletions(-)

Thanks.

--
tejun

[1] http://lkml.kernel.org/r/20180323231313.1254142-1-tj@kernel.org

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

end of thread, other threads:[~2018-04-06 12:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-24 16:08 [PATCHSET] mm, memcontrol: Make cgroup_rstat available to controllers Tejun Heo
2018-03-24 16:08 ` [PATCH 1/3] mm: memcontrol: Use cgroup_rstat for event accounting Tejun Heo
2018-04-04 14:08   ` Johannes Weiner
2018-04-04 14:18     ` Johannes Weiner
2018-04-04 14:34       ` Michal Hocko
2018-04-04 16:58         ` Tejun Heo
2018-04-05 17:55           ` [PATCH] mm: memcg: make sure memory.events is uptodate when waking pollers Johannes Weiner
2018-04-05 19:45             ` Tejun Heo
2018-04-06 12:03             ` Michal Hocko
2018-03-24 16:09 ` [PATCH 2/3] mm: memcontrol: Use cgroup_rstat for stat accounting Tejun Heo
2018-03-24 16:09 ` [PATCH 3/3] mm: memcontrol: Remove lruvec_stat Tejun Heo
2018-04-04 14:13   ` Johannes Weiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).