[question] hugetlb: how to find who use hugetlb?

From: Xishi Qiu
Date: Sun Sep 18 2016 - 22:40:05 EST

On my system, I set HugePages_Total to 2G(1024 x 2M), and I use 1G hugetlb,
but the HugePages_Free is not 1G(512 x 2M), it is 280(280 x 2M) left,
HugePages_Rsvd is 0, it seems someone use 232(232 x 2M) hugetlb additionally.

So how to find who use the additional hugetlb?

I search every process and find the total hugetlb size is only 1G,
cat /proc/xx/smaps | grep KernelPageSize, then account the vma size
which KernelPageSize is 2048 kB.

Xishi Qiu