[dpdk-dev] [PATCH] eal: fix mem alloc from control thread if socket 0 is unused
David Marchand
david.marchand at redhat.com
Fri Nov 5 15:26:43 CET 2021
On Thu, Nov 4, 2021 at 9:54 AM Olivier Matz <olivier.matz at 6wind.com> wrote:
> > > From: Ilyes Ben Hamouda <ilyes.ben_hamouda at 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: stable at dpdk.org
> > >
> > > Signed-off-by: Ilyes Ben Hamouda <ilyes.ben_hamouda at 6wind.com>
> > > Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
Acked-by: David Marchand <david.marchand at 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
More information about the dev
mailing list