NUMA-aware named shared memory for Linux

Viewed 1223

The Windows API offers the CreateFileMappingNuma function (http://msdn.microsoft.com/en-us/library/windows/desktop/aa366539(v=vs.85).aspx) to create a named shared memory space on a specific NUMA node.

So far, I have not found an equivalent function for Linux.

My current approach looks like this:

  1. Allocate named shared memory (using shm_open(...))
  2. Determine current NUMA node (using numa_move_pages(...))
  3. Move pages to target Node (using numa_move_pages(...) again)

Does anyone know a better approach?

EDIT: For the record: My proposed implementation does work as expected!

1 Answers
Related