c++ - Linux API to get Hugepagesize -
how can the hugepagesize value in /proc/meminfo
hugepagesize: 2048 kb
without parsing /proc/meminfo?
i can regular page size using
#include <unistd.h> long sz = sysconf(_sc_pagesize);
is there sysconf argument provide hugepagesize?
i don't think linux exposes programmatic api getting value form userspace. agree comments here... /proc/meminfo solid alternative.
you can @ kernel code in $kernel/fs/proc/meminfo.c see how it's derived:
> meminfo_proc_show() > hugetlb_report_meminfo() > 1ul << (huge_page_order(h) + page_shift - 10) // actual value
Comments
Post a Comment