Re: [patch] mm, thp: track fallbacks due to failed memcg charges separately
From: David Rientjes
Date: Tue Feb 18 2020 - 20:59:28 EST
On Tue, 18 Feb 2020, Kirill A. Shutemov wrote:
> On Mon, Feb 17, 2020 at 09:41:40PM -0800, David Rientjes wrote:
> > The thp_fault_fallback stat in either /proc/vmstat is incremented if
> > either the hugepage allocation fails through the page allocator or the
> > hugepage charge fails through mem cgroup.
> >
> > This patch leaves this field untouched but adds a new field,
> > thp_fault_fallback_charge, which is incremented only when the mem cgroup
> > charge fails.
> >
> > This distinguishes between faults that want to be backed by hugepages but
> > fail due to fragmentation (or low memory conditions) and those that fail
> > due to mem cgroup limits. That can be used to determine the impact of
> > fragmentation on the system by excluding faults that failed due to memcg
> > usage.
> >
> > Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
>
> The patch looks good to me, but I noticed that we miss THP_FAULT_FALLBACK
> (and THP_FAULT_FALLBACK_CHARGE) accounting in shmem_getpage_gfp().
>
> Could you fix this while you are there?
Sure, I'll add it as a predecessor and also count THP_FAULT_ALLOC for
consistency.