libhsakmt: Ignore mbind failure if flag NoSubstitute = 0

From Thunk spec, flag NoSubstitute = 0, if specific memory type is not
available on node, allocation may fall back to other memory that can
replace it on that node. mbind return failure if no memory available on
the specific node, we should ignore the mbind failure for this case.




Change-Id: I651a1bedf1852330604e56965cc17862403ebf87
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
This commit is contained in:
Philip Yang
2020-01-23 15:50:10 -05:00
والد 634b30119a
کامیت 5858aa17a9
+7 -3
مشاهده پرونده
@@ -1492,9 +1492,6 @@ static int bind_mem_to_numa(uint32_t node_id, void *mem,
numa_bitmask_free(node_mask);
if (r) {
pr_warn_once("Failed to set NUMA policy for %p: %s\n", mem,
strerror(errno));
/* If applcation is running inside docker, still return
* ok because docker seccomp blocks mbind by default,
* otherwise application cannot allocate system memory.
@@ -1505,6 +1502,13 @@ static int bind_mem_to_numa(uint32_t node_id, void *mem,
return 0;
}
/* Ignore mbind failure if no memory available on node */
if (!flags.ui32.NoSubstitute)
return 0;
pr_warn_once("Failed to set NUMA policy for %p: %s\n", mem,
strerror(errno));
return -EFAULT;
}