I want to allocate memory among all the nodes' memory within the NUMA in a way that I can control (for example, allocate a
in node1
's memory, allocate b
in node2
's memory, and allocate c
in node4's memory…).
Is there any way to achieve this?
Maybe could you use the
numa_alloc_onnode
function (NUMA policy library) to achieve your goal but such allocations are slow.But bear in mind that NUMA memory affinity is strongly linked to the executing thread which is running on a core [thread->core->NUMA node]. I believe you know what you are doing.
http://man7.org/linux/man-pages/man3/numa.3.html