title: huge page calculation in linux
body: <p>I have the following config in linux :</p>
  
  <pre><code>cat /proc/sys/vm/nr_hugepages
  100 
  
  cat /proc/meminfo | grep "Page"
  AnonPages:        149012 kB
  PageTables:        13800 kB
  AnonHugePages:      4096 kB
  HugePages_Total:     100
  HugePages_Free:      100
  HugePages_Rsvd:        0
  HugePages_Surp:        0
  
  numastat -m 
  Per-node system memory usage (in MBs):
                            Node 0          Node 1           Total
               --------------- --------------- ---------------
  HugePages_Total           100.00          100.00          200.00
  HugePages_Free            100.00          100.00          200.00
  </code></pre>
  
  <p>then I run my test application which consume hugepage , then watch again :</p>
  
  <pre><code>AnonPages:        146592 kB
  PageTables:        13316 kB
  AnonHugePages:      4096 kB
  HugePages_Total:     100
  HugePages_Free:       82
  HugePages_Rsvd:        0
  HugePages_Surp:        0
  
  Per-node system memory usage (in MBs):
                            Node 0          Node 1           Total
               --------------- --------------- ---------------
  HugePages_Total           100.00          100.00          200.00
  HugePages_Free            100.00           64.00          164.00
  </code></pre>
  
  <p>Why numastat -m showes node1 has 64MB free but meminfo showes 82 pages free ,
  which number I got it wrong ?! or I got both wrong ?!</p>