mm: memcontrol: implement lruvec stat functions on top of each other
authorJohannes Weiner <[email protected]>
Thu, 1 Feb 2018 00:16:41 +0000 (16:16 -0800)
committerLinus Torvalds <[email protected]>
Thu, 1 Feb 2018 01:18:36 +0000 (17:18 -0800)
commit284542656e22c43fdada8c8cc0ca9ede8453eed7
tree5f815001470c5f76ede887f9da9272772e9219ca
parentc9019e9bf42e66d028d70d2da6206cad4dd9250d
mm: memcontrol: implement lruvec stat functions on top of each other

The implementation of the lruvec stat functions and their variants for
accounting through a page, or accounting from a preemptible context, are
mostly identical and needlessly repetitive.

Implement the lruvec_page functions by looking up the page's lruvec and
then using the lruvec function.

Implement the functions for preemptible contexts by disabling preemption
before calling the atomic context functions.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Johannes Weiner <[email protected]>
Acked-by: Vladimir Davydov <[email protected]>
Cc: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/memcontrol.h