Re: [PATCH] mm: add ZONE_DEVICE statistics to smaps

From: Christoph Hellwig
Date: Tue Nov 15 2016 - 13:50:27 EST


Hi Dan,

On Mon, Nov 14, 2016 at 07:14:22PM -0800, Dan Williams wrote:
> Wanted to get your opinion on this given your earlier concerns about
> the VM_DAX flag.
>
> This instead lets an application know how much of a vma is backed by
> ZONE_DEVICE pages, but does not make any indications about the vma
> having DAX semantics or not. I.e. it is possible that 'device' and
> 'device_huge' are non-zero *and* vma_is_dax() is false. So, it is
> purely accounting the composition of the present pages in the vma.
>
> Another option is to have something like 'shared_thp' just to account
> for file backed huge pages that dax can map. However if ZONE_DEVICE
> is leaking into other use cases I think it makes sense to have it be a
> first class-citizen with respect to accounting alongside
> 'anonymous_thp'.

This counter sounds fine to me, it's a debug tool and not an obvious
abuse candidate like VM_DAX. But I'll defer to the VM folks for a real
review.