autotest: Don't override default amount of hugepages on Linux to 8GB

This is relevant mostly for the VMs. Allocating that much memory puts
a lot of pressure on remaining pieces of the system as currently we
allocate total of 12GB memory per VM instance in the CI pool. Default of
4GB hp should be enough to cover majority of the tests hence if there's
any suite that requires more memory, setup.sh should be called there
directly with an optimal value.

This is done to make sure we can accomodate proper resources in the CI
by knowing what are the actual requirements rather than just blindly
allocating "as much as possible".

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie958c518c7ed702b068c7fc9042183fdf41aa816
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8436
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Michal Berger 2021-06-18 12:28:21 +02:00 committed by Jim Harris
parent 928db41626
commit 227428c3a4
4 changed files with 19 additions and 9 deletions

View File

@ -152,11 +152,6 @@ timing_enter afterboot
timing_exit afterboot timing_exit afterboot
if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then
# Make sure that memory is distributed across all NUMA nodes - by default, all goes to
# node0, but if QAT devices are attached to a different node, all of their VFs will end
# up under that node too and memory needs to be available there for the tests.
CLEAR_HUGE=yes HUGE_EVEN_ALLOC=yes ./scripts/setup.sh
./scripts/setup.sh status
if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then
./scripts/qat_setup.sh igb_uio ./scripts/qat_setup.sh igb_uio
else else

View File

@ -221,10 +221,16 @@ if [ $SPDK_RUN_VALGRIND -eq 0 ]; then
fi fi
if [ "$(uname -s)" = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
export HUGEMEM=4096 CLEAR_HUGE=yes
if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then
# Make sure that memory is distributed across all NUMA nodes - by default, all goes to
# node0, but if QAT devices are attached to a different node, all of their VFs will end
# up under that node too and memory needs to be available there for the tests.
export HUGE_EVEN_ALLOC=yes
fi
MAKE="make" MAKE="make"
MAKEFLAGS=${MAKEFLAGS:--j$(nproc)} MAKEFLAGS=${MAKEFLAGS:--j$(nproc)}
# Override the default HUGEMEM in scripts/setup.sh to allocate 8GB in hugepages.
export HUGEMEM=8192
if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then
export DRIVER_OVERRIDE=igb_uio export DRIVER_OVERRIDE=igb_uio
# Building kernel modules requires root privileges # Building kernel modules requires root privileges

View File

@ -15,6 +15,12 @@ default_huges=$(get_meminfo Hugepagesize)
default_huge_nr=/sys/kernel/mm/hugepages/hugepages-${default_huges}kB/nr_hugepages default_huge_nr=/sys/kernel/mm/hugepages/hugepages-${default_huges}kB/nr_hugepages
global_huge_nr=/proc/sys/vm/nr_hugepages global_huge_nr=/proc/sys/vm/nr_hugepages
# Make sure environment doesn't affect the tests
unset -v HUGE_EVEN_ALLOC
unset -v HUGEMEM
unset -v HUGENODE
unset -v NRHUGE
get_nodes() { get_nodes() {
local node local node
@ -104,8 +110,8 @@ verify_nr_hugepages() {
# Test cases # Test cases
default_setup() { default_setup() {
# Default HUGEMEM (8G) alloc on node0 # Default HUGEMEM (2G) alloc on node0
get_test_nr_hugepages $((HUGEMEM * 1024)) 0 get_test_nr_hugepages $((2048 * 1024)) 0
setup setup
verify_nr_hugepages verify_nr_hugepages
} }

View File

@ -43,3 +43,6 @@ function check_match() {
$rootdir/test/app/match/match $testdir/match_files/${MATCH_FILE}.match $rootdir/test/app/match/match $testdir/match_files/${MATCH_FILE}.match
rm -f $testdir/match_files/${MATCH_FILE} rm -f $testdir/match_files/${MATCH_FILE}
} }
# Allocate 5GB of hugepages to have some overhead for run_*()s
HUGEMEM=5120 CLEAR_HUGE=yes "$rootdir/scripts/setup.sh"