mem: improve autodetection of hugepage counts on 32-bit
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 24 Apr 2018 10:19:24 +0000 (11:19 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 27 Apr 2018 21:52:51 +0000 (23:52 +0200)
commit1be7644986261377a588f2ee7e1cdcbab4710896
tree2d25cb881fc313a0261b0cffd3f94dacd651819a
parente82ca1a75edaf4bc5836f61f9c03af14b95a5194
mem: improve autodetection of hugepage counts on 32-bit

For non-legacy mode, we are preallocating space for hugepages, so
we know in advance which pages we will be able to allocate, and
which we won't. However, the init procedure was using hugepage
counts gathered from sysfs and paid no attention to hugepage
sizes that were actually available for reservation, and failed
on attempts to reserve unavailable pages.

Fix this by limiting total page counts by number of pages
actually preallocated.

Also, VA preallocate procedure only looks at mountpoints that are
available, and expects pages to exist if a mountpoint exists. That
might not necessarily be the case, so also check if there are
hugepages available for a particular page size on a particular
NUMA node.

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
lib/librte_eal/linuxapp/eal/eal_memory.c