[dpdk-stable] [PATCH] eal/linux: fix memory allocations in containers+SELinux

David Marchand david.marchand at redhat.com
Thu Sep 17 15:47:28 CEST 2020


On Fri, Sep 11, 2020 at 2:46 PM Burakov, Anatoly
<anatoly.burakov at intel.com> wrote:
> > Removing hugepage files is done in multiple places and the memory
> > allocation code is complex.
> > This fix tries to do the minimum and avoids touching other paths.
> >
> > If trying to remove the hugepage file before allocating a page fails,
> > the error is reported to the caller and the user will see a memory
> > allocation error log.
> >
> > Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: David Marchand <david.marchand at redhat.com>
> > ---
>
> I believe only the primary will try to allocate new pages, but this only
> covers the page-per-file scenario. There's also legacy mem option (which
> would attempt to remove files prior to creating new ones - not sure if
> it's refused in that case), and single file segments option (which will
> mostly fallocate holes rather than delete files, but may still attempt
> to delete files - by the way, how does fallocate work with SELinux?).

This issue should only concern part of the memory allocator that deals
with "named files" backed hugepages.
I would focus on the code relying on eal_get_hugefile_path() and I
agree I might have missed the legacy-mem part.

For anonymous hugepages this should not matter.


-- 
David Marchand



More information about the stable mailing list