[dpdk-dev] [PATCH] mem: don't use address hint for mapping unless requested
shahafs at mellanox.com
Thu Mar 28 09:45:39 CET 2019
Wednesday, March 27, 2019 1:50 PM, Burakov, Anatoly:
> Subject: Re: [PATCH] mem: don't use address hint for mapping unless
> On 21-Mar-19 8:21 PM, Shahaf Shuler wrote:
> > patch added an address hint as starting address for 64 bit systems
> > in case an explicit base virtual address was not set by the user.
> > The justification for such hint was to help devices that work in VA
> > mode and has a address range limitation to work smoothly with the eal
> > memory subsystem.
> > While the base address value selected may work fine for the eal
> > initialization, it easily breaks when trying to register external
> > memory using rte_extmem_register API.
> > Trying to register anonymous memory on RH x86_64 machine took several
> > minutes, during them the function eal_get_virtual_area repeatedly
> > scanned for a good VA candidate.
> > The attempt to guess which VA address will be free for mapping will
> > always result in not portable, error prone code:
> > * different application may use different libraries along w/ DPDK. One
> > can never guess which library was called first and how much virtual
> > memory it consumed.
> > * external memory can be registered at any time in the application run
> > time.
> > This patch removes the default address hint and use the address
> > returned by mmap.
> > devices with address limitations should suggest to their users a
> > proper base-virtaddr (EAL arg) to use.
> > Fixes: 1df21702873d ("mem: use address hint for mapping hugepages")
> > Cc: stable at dpdk.org
> > Cc: alejandro.lucero at netronome.com
> >  commit 1df21702873d ("mem: use address hint for mapping
> > hugepages")
> > Signed-off-by: Shahaf Shuler <shahafs at mellanox.com>
> > ---
> I understand the motivation, however this will lower the reliability of
> secondary process initialization.
Can you explain why?
It is very bad if we base the DPDK secondary process design on some predefined VA address base to be available.
Perhaps, the hinting could be improved by
> not trying to use the hint multiple times, but rather just once? I.e.
> if using hint succeeded - great, if not - try without one. Most of the time hint
> will work correctly, i think.
More information about the dev