[dpdk-dev] [PATCH 17.11] mem: fix memory initialization time

Alejandro Lucero alejandro.lucero at netronome.com
Fri Nov 16 13:49:43 CET 2018


On Thu, Nov 15, 2018 at 1:16 PM Burakov, Anatoly <anatoly.burakov at intel.com>
wrote:

> On 12-Nov-18 11:18 AM, Alejandro Lucero wrote:
> > When using large amount of hugepage based memory, doing all the
> > hugepages mapping can take quite significant time.
> >
> > The problem is hugepages being initially mmaped to virtual addresses
> > which will be tried later for the final hugepage mmaping. This causes
> > the final mapping requiring calling mmap with another hint address which
> > can happen several times, depending on the amount of memory to mmap, and
> > which each mmmap taking more than a second.
> >
> > This patch changes the hint for the initial hugepage mmaping using
> > a starting address which will not collide with the final mmaping.
> >
> > Fixes: 293c0c4b957f ("mem: use address hint for mapping hugepages")
> >
> > Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
> > ---
>
> Hi Alejandro,
>
> I'm not sure i understand the purpose. When final mapping is performed,
> we reserve new memory area, and map pages into it. (i don't quite
> understand why we unmap the area before mapping pages, but it's how it's
> always been and i didn't change it in the legacy code)
>
> Which addresses are causing the collision?
>
>
Because the hint for the final mapping is at 4GB address, and the hugepages
are initially individually mapped starting at low virtual addresses, when
the memory to map is 4GB or higher, the hugepages will end using that hint
address and higher. The more the hugepages to mmap, the more addresses
above the hint address are used, and the more mmaps failed for getting the
virtual addresses for the final mmap.


> --
> Thanks,
> Anatoly
>


More information about the dev mailing list