Pradeep Satyanarayana wrote: > Roland Dreier wrote: >> > Maybe we should use the /proc/pid/pagemap and /proc/kpageflags files? >> > These files let a userspace process find out which physical frame >> > each virtual page is mapped to and to get the properties of each page >> > frame including the page size. >> >> Sounds interesting... the only problem is that /proc/kpageflags is >> root-only, so we can't use that. But does /proc/pid/pagemap give enough >> information to be useful? > > The most useful information that /proc/pid/pagemap provides the PFN (if the > page is not swapped out). In fact there is very useful tool called > Documentation/vm/page-types.c which gives a lot of the information that we > need. Again the caveat is that it uses /proc/kpageflags.
Roland, Documentation/vm/page-types didn't turn out to be as interesting as expected. It does show the usage of huge pages, but it seems to provide system information and not process specific. The possible alternatives and their limitations are: 1. /proc/pid/maps - usable only with libhugetlfs 2. page-type and friends -/proc/kpageflgs is readable by root only (plus additional limitations described above). 3. /proc/pid/smaps -this provides KernelPageSize/MMUPageSize information (on recent kernels) with and without libhugetlbfs. Parsing this may be slow, but how often would it be used? Given the above, I see /proc/pid/smaps as one alternative that provides a complete solution. Are there others? What are your thoughts? Pradeep -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
