mem: make segment preallocation OS-specific
authorAnatoly Burakov <anatoly.burakov@intel.com>
Thu, 28 Jun 2018 11:41:49 +0000 (12:41 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 12 Jul 2018 22:59:18 +0000 (00:59 +0200)
commit1d406458db476adb12c5be004eca893637143556
tree786a13601851ebce52066f63aaeae7d7b9957e67
parente1589061ccc9de253f67684119fb0f4b9c721255
mem: make segment preallocation OS-specific

In the perfect world, it wouldn't matter how much memory was
preallocated because most of it was always going to be private
anonymous zero-page mappings for the duration of the program.
However, in practice, due to peculiarities of FreeBSD, we need
to additionally limit memory allocation there. This patch moves
the segment preallocation to EAL private functions that will be
implemented by an OS-specific EAL rather than being in the common
memory-related code.

Since there is no support for growing/shrinking memory use at
runtime on FreeBSD anyway, this does not inhibit any functionality
but makes core dumps faster even on default settings.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/bsdapp/eal/eal_memory.c
lib/librte_eal/common/eal_common_memory.c
lib/librte_eal/common/eal_private.h
lib/librte_eal/linuxapp/eal/eal_memory.c