You should be able to do that today but it's not a particularly friendly
task. I expect without decent knowledge of how hugepages work that you'll get
it wrong. A userspace tool could do this of course and likely would use stat
on the file to get teh blocksize if it was hugetlbfs instead of consulting
mounts. It's just not as user-friendly. Consider "cat smaps" as opposed to
download this tool, run it and it'll give you an smaps-like output.
What's wrong with
KernelPageSize: X kB
now which a parser can easily handle and later
KernelPageSize: X kb * nX Y kB * nY
where X is a pagesize, nX is the number of pages of that size in a VMA
later? The second format should not break a naive parser.
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--