Re: [PATCH 08/18] mm: memcontrol: prepare cgroup vmstat infrastructure for native anon counters

From: Joonsoo Kim
Date: Wed Apr 22 2020 - 02:42:17 EST


On Mon, Apr 20, 2020 at 06:11:16PM -0400, Johannes Weiner wrote:
> Anonymous compound pages can be mapped by ptes, which means that if we
> want to track NR_MAPPED_ANON, NR_ANON_THPS on a per-cgroup basis, we
> have to be prepared to see tail pages in our accounting functions.
>
> Make mod_lruvec_page_state() and lock_page_memcg() deal with tail
> pages correctly, namely by redirecting to the head page which has the
> page->mem_cgroup set up.
>
> Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>

Reviewed-by: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>