Similar to this post, I would like to create a named shared memory segment (created via shm_open() + mmap() on CentOS 7) on a specific NUMA node (not necessarily local). The post suggested that it be achieved by using numa_move_pages().
I have few more questions:
if another process (running on a core local to a different NUMA ) later starts and
mmap()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?Is there any other situation that a named shared memory segment will be moved to another NUMA after I specify through
numa_move_pages()?Given a named shared memory segment in
/shm/dev, how can I check which NUMA node it belongs to?
I looked into numactl, and its --membind option is closed to what I want, but I am not sure what the effect if two different processes use --membind to 2 different nodes. Who wins? I guess I can test it out if #3 is answered.
Thanks!