]> www.infradead.org Git - users/dwmw2/linux.git/commit
mm: memcontrol: implement lruvec stat functions on top of each other
authorJohannes Weiner <hannes@cmpxchg.org>
Tue, 29 Dec 2020 02:35:58 +0000 (02:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Jan 2021 12:37:37 +0000 (13:37 +0100)
commit955f8bc9eb69b3be9a7785015c726f7004ec36b9
tree17ef68c1578f564252730ea2471000fd6365cf4b
parentfdcda71d87acfe8f645f3ce5e9303688cad8b8f1
mm: memcontrol: implement lruvec stat functions on top of each other

commit 284542656e22c43fdada8c8cc0ca9ede8453eed7 upstream

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/20171103153336.24044-2-hannes@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/memcontrol.h