[v2] malloc: enhance NUMA affinity heuristic
Checks
Commit Message
Trying to allocate memory on the first detected numa node has less
chance to find some memory actually available rather than on the main
lcore numa node (especially when the DPDK application is started only
on one numa node).
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- accomodate for configurations with main lcore running on multiples
physical cores belonging to different numa,
---
lib/eal/common/malloc_heap.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -717,6 +717,10 @@ malloc_get_numa_socket(void)
return socket_id;
}
+ socket_id = rte_lcore_to_socket(rte_get_main_lcore());
+ if (socket_id != (unsigned int)SOCKET_ID_ANY)
+ return socket_id;
+
return rte_socket_id_by_idx(0);
}