libhsakmt: use the closest NUMA node to allocate queue ctx area

On NUMA system, allocate queue ctx save restore area on the closest NUMA
node to the GPU which the queue is going to run. This will improve
performance on NUMA system generally by reducing schedule latency and
fix the multi-node rccl-tests unstable performance issue.

If the closest NUMA node has no memory available, set flags NoNUMABind=1
to bypass mbind, to use default NUMA memory policy to allocate system
memory.



Change-Id: Ic62bfa5bb2efbf4f6ae79ff403e9610ddf18d45c
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
This commit is contained in:
Philip Yang
2019-11-06 14:32:25 -05:00
parent e7f45fae8a
commit 59c857476f
4 changed files with 36 additions and 2 deletions
+3
View File
@@ -1462,6 +1462,9 @@ static int bind_mem_to_numa(uint32_t node_id, void *mem,
int num_node;
long r;
pr_debug("%s mem %p flags 0x%x size 0x%lx node_id %d\n", __func__,
mem, flags.Value, SizeInBytes, node_id);
if (flags.ui32.NoNUMABind)
return 0;