mem: improve preallocation on 32-bit
authorAnatoly Burakov <anatoly.burakov@intel.com>
Fri, 20 Apr 2018 15:25:26 +0000 (16:25 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 27 Apr 2018 21:52:51 +0000 (23:52 +0200)
commite82ca1a75edaf4bc5836f61f9c03af14b95a5194
tree4ebd85e3ec9e41bb29c54fa7887f25bc1b839adb
parenta99e8df63f8ab4b782dc5249682ab1152ff2965f
mem: improve preallocation on 32-bit

Previously, if we couldn't preallocate VA space on 32-bit for
one page size, we simply bailed out, even though we could've
tried allocating VA space with other page sizes.

For example, if user had both 1G and 2M pages enabled, and
has asked DPDK to allocate memory on both sockets, DPDK
would've tried to allocate VA space for 1x1G page on both
sockets, failed and never tried again, even though it
could've allocated the same 1G of VA space for 512x2M pages.

Fix this by retrying with different page sizes if VA space
reservation failed.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>
lib/librte_eal/common/eal_common_memory.c