To allocate a System V shared memory segment, one can use shmget() with the SHM_HUGETLB flag.
Is there a way to check whether a System V shared memory segment is backed by huge pages or regular pages assuming that we do not know how the original creator of this memory segment used the shmget() system call.
Ok, I think I figured it out.
One method is to attach to the shared memory segment (or rely on a process which is already attached), and examine /proc/[PID]/smaps to find the shared memory segment of interest and look at the corresponding KernelPageSize field to see it matches up with the server's configured Hugepagesize
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With