mm, memcontrol: implement memory.swap.events
authorTejun Heo <[email protected]>
Fri, 8 Jun 2018 00:05:35 +0000 (17:05 -0700)
committerLinus Torvalds <[email protected]>
Fri, 8 Jun 2018 00:34:34 +0000 (17:34 -0700)
commitf3a53a3a1e5b3b9bc114b5b7930fbe89d9ffed5d
treecd8bc51d0629333b6b1a1c9da5fa23eb5a92e855
parentbb98f2c5ac5db92d34908dbac81a8de7c47c8353
mm, memcontrol: implement memory.swap.events

Add swap max and fail events so that userland can monitor and respond to
running out of swap.

I'm not too sure about the fail event.  Right now, it's a bit confusing
which stats / events are recursive and which aren't and also which ones
reflect events which originate from a given cgroup and which targets the
cgroup.  No idea what the right long term solution is and it could just
be that growing them organically is actually the only right thing to do.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Tejun Heo <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Documentation/admin-guide/cgroup-v2.rst
include/linux/memcontrol.h
mm/memcontrol.c