title: usage of hugepages for text and data segments
body: <p>I am exploring the possibility to back the text and data segment with hugepages following the guide in <a href="https://github.com/libhugetlbfs/libhugetlbfs/blob/master/HOWTO" rel="nofollow">https://github.com/libhugetlbfs/libhugetlbfs/blob/master/HOWTO</a>. </p>
  
  <p>I have relinked the application as suggested by adding "-B/usr/share/libhugetlbfs -Wl,--hugetlbfs-align" and started the application with "hugectl --text --data --heap --bss /path/to/my/application". </p>
  
  <p>But I am not very sure how to verify whether the data and text segments are indeed copied to the files on the hugetlbfs filesystem.</p>
  
  <p>Checking the /proc/{pid}/maps, it could be seen that the hugepages are used for heap but not for text and data segments as the first two address ranges are mapped to the application but not the hugepage file system. </p>
  
  <p>Is my understanding correct? Actually I suspect my conclusion that hugepages are used for heap from /proc/{pid}/maps is also incorrect.</p>
  
  <p>How should I verify whether the data and text segments are backed in the hugepages? I know that data and text segments will be copied to hugetlbfs filesystem if successful but how to verify it?</p>
  
  <p>Thanks!</p>
  
  <p>output of /proc/{pid}/maps</p>
  
  <pre><code>00400000-00d2c000 r-xp 00000000 fd:02 46153351 /path/to/my/application
  
  00f2b000-00fa3000 rw-p 0092b000 fd:02 46153351 /path/to/my/application
  
  00fa3000-00fbb000 rw-p 00000000 00:00 0
  
  02a0c000-02a2d000 rw-p 00000000 00:00 0  [heap]
  
  40000000-80000000 rw-p 00000000 00:15 2476090 /dev/hugepages-1G/libhugetlbfs.tmp.nS7exn (deleted)
  </code></pre>