title: How to restrict ALL memory allocation to one NUMA node
body: <p>I am new to NUMA-aware multithreaded programming. I am writing my code such that all the threads and their memory allocation are restricted to one node. At the beginning of the program, I make the following calls:</p>
  
  <pre class="lang-c prettyprint-override"><code>struct bitmask *bm = numa_parse_nodestring("0");
  if (bm == 0) {
      exit(1);
  }
  numa_bind(bm);
  </code></pre>
  
  <p>My understanding is that a call to numa_bind in this way would bind all threads and all memory allocation to node 0.</p>
  
  <p>Furthermore, when I start pthreads from this code, I bind them to specific CPUs using:</p>
  
  <pre class="lang-c prettyprint-override"><code>pthread_setaffinity_n
  </code></pre>
  
  <p>However, when I look at /proc//numa_maps, I can still see that certain libraries (e.g., libc) are bound to the memory on node 1. How can I make sure that all the memory required by the process is bound to node 0?</p>