title: numa, mbind, segfault
body: <p>I have allocated memory using valloc, let's say array A of [15*sizeof(double)]. Now I divided it into three pieces and I want to bind each piece (of length 5) into three NUMA nodes (let's say 0,1, and 2). Currently, I am doing the following:</p>
  
  <pre><code>double* A=(double*)valloc(15*sizeof(double));
  
  piece=5; 
  nodemask=1;
  mbind(&amp;A[0],piece*sizeof(double),MPOL_BIND,&amp;nodemask,64,MPOL_MF_MOVE);
  
  nodemask=2;
  mbind(&amp;A[5],piece*sizeof(double),MPOL_BIND,&amp;nodemask,64,MPOL_MF_MOVE);
  
  nodemask=4;
  mbind(&amp;A[10],piece*sizeof(double),MPOL_BIND,&amp;nodemask,64,MPOL_MF_MOVE);
  </code></pre>
  
  <p>First question is am I doing it right? I.e. is there any problems with being properly aligned to page size for example? Currently with size of 15 for array A it runs fine, but if I reset the array size to something like 6156000 and piece=2052000, and subsequently three calls to mbind start with &amp;A[0], &amp;A[2052000], and &amp;A[4104000] then I am getting a segmentation fault (and sometimes it just hangs there). Why it runs for small size fine but for larger gives me segfault? Thanks.</p>