title: Create Named Shared Memory on a Specific NUMA Node?
body: <p>Similar to this <a href="https://stackoverflow.com/questions/11962018/numa-aware-named-shared-memory-for-linux">post</a>, I would like to create a named shared memory segment (created via <code>shm_open()</code> + <code>mmap()</code> on CentOS 7) on a specific NUMA node (not necessarily local).  The post suggested that it be achieved by using <code>numa_move_pages()</code>.</p>
  
  <p>I have few more questions:</p>
  
  <ol>
  <li><p>if another process (running on a core local to a different NUMA ) later starts and <code>mmap()</code>s to the same named shared memory segment, will OS decide to move the named shared memory segment to a NUMA local to this process?  If yes, how can I prevent it?</p></li>
  <li><p>Is there any other situation that a named shared memory segment will be moved to another NUMA after I specify through <code>numa_move_pages()</code>?</p></li>
  <li><p>Given a named shared memory segment in <code>/shm/dev</code>, how can I check which NUMA node it belongs to?</p></li>
  </ol>
  
  <p>I looked into <code>numactl</code>, and its <code>--membind</code> option is closed to what I want, but I am not sure what the effect if two different processes use <code>--membind</code> to 2 different nodes.  Who wins?  I guess I can test it out if #3 is answered.</p>
  
  <p>Thanks!</p>