On Thu, Nov 4, 2021 at 9:54 AM Olivier Matz <olivier.m...@6wind.com> wrote: > > > From: Ilyes Ben Hamouda <ilyes.ben_hamo...@6wind.com> > > > > > > When using rte_malloc() from a control thread, the used heap is the one > > > from numa socket 0, which may not have available memory. > > > > > > Fix this by selecting the first socket which has available memory. > > > > > > Note: malloc_get_numa_socket() is only used from one .c file, so move > > > it there, and remove the inline keyword. > > > > > > Fixes: b94580d6887e ("malloc: avoid unknown socket id") > > > Cc: sta...@dpdk.org > > > > > > Signed-off-by: Ilyes Ben Hamouda <ilyes.ben_hamo...@6wind.com> > > > Signed-off-by: Olivier Matz <olivier.m...@6wind.com>
Acked-by: David Marchand <david.march...@redhat.com> > I didn't know this was possible (and still wonder in which case it can > be useful). But yes, I can send a new version with an updated title and > commit log. What about this one below? No need for a v2, I took your suggestion. Applied, thanks. > > eal: fix mem alloc from thread having unknown socket id > > When using rte_malloc() from a thread which is not bound to a numa > socket (the typical case is a control thread, but it can also happen > on a dataplane thread if its cpu affinity is on cores attached to > several sockets), the used heap is the one from numa socket 0, which > may not have available memory. > > Fix this by selecting the first socket which has available memory. > > Note: malloc_get_numa_socket() is only used from one .c file, so move > it there, and remove the inline keyword. > -- David Marchand