scripts/setup: abort on hugepage allocation failure

Change-Id: I01ba59c8bd6fb54e15e3896c7e077ec91fdb88f7
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/384087
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-10-27 19:56:36 +02:00 committed by Ben Walker
parent 7ef370dc8f
commit 261013ad1a

View File

@ -146,6 +146,13 @@ function configure_linux {
fi
echo "$NRHUGE" > "$hugepages_target"
allocated_hugepages=`cat $hugepages_target`
if [ "$allocated_hugepages" -lt "$NRHUGE" ]; then
echo ""
echo "## ERROR: requested $NRHUGE hugepages but only $allocated_hugepages could be allocated."
echo "## Memory might be heavily fragmented. Please try flushing the system cache, or reboot the machine."
exit 1
fi
if [ "$driver_name" = "vfio-pci" ]; then
if [ "$username" != "" ]; then