[dpdk-dev] [PATCH] mem: fix free segment when using huge-unlink option

David Marchand david.marchand at redhat.com
Wed Apr 7 11:09:46 CEST 2021


On Thu, Apr 1, 2021 at 1:07 PM Burakov, Anatoly
<anatoly.burakov at intel.com> wrote:
>
> On 22-Feb-21 10:41 AM, Roy Shterman wrote:
> > When using huge_unlink we unlink the segment right
> > after allocation. Although we unlink the file we keep
> > the fd in fd_list so file still exist just the path deleted.
> > When freeing the hugepage we need to close the fd and assign
> > it with (-1) in fd_list for the page to be released.
> >
> > The current flow fails rte_malloc in the following flow when working
> > with --huge-unlink option:
> > 1. alloc_seg() for segment A -
> >      We allocate segment, unlink the path to the segment
> >      and keep the file descriptor in fd_list.
> > 2. free_seg() for segment A -
> >      We clear the segment metadata and return - without closing fd
> >      or assigning (-1) in fd list.
> > 3. alloc_seg() for segment A again -
> >      We find segment A as available, try to allocate it,
> >      find the old fd in fd_list try to unlink it
> >      as part of alloc_seg() but failed because path doesn't exist.
> >
> > The impact of such error is falsly failing rte_malloc()
falsely*

> > although we have hugepages available.
> >
> > Fixes: d435aad37da7 ("mem: support --huge-unlink mode")
Cc: stable at dpdk.org

> >
> > Signed-off-by: Roy Shterman <roy.shterman at vastdata.com>
> Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

Applied, thanks.


-- 
David Marchand



More information about the dev mailing list