diff --git a/autotest.sh b/autotest.sh index 4020553ef5..554b8e3fb6 100755 --- a/autotest.sh +++ b/autotest.sh @@ -152,11 +152,6 @@ timing_enter afterboot timing_exit afterboot 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 ./scripts/qat_setup.sh igb_uio else diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 61970afc14..9f215f9506 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -221,10 +221,16 @@ if [ $SPDK_RUN_VALGRIND -eq 0 ]; then fi 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" 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 export DRIVER_OVERRIDE=igb_uio # Building kernel modules requires root privileges diff --git a/test/setup/hugepages.sh b/test/setup/hugepages.sh index fd6eb699af..59cd46b4c8 100755 --- a/test/setup/hugepages.sh +++ b/test/setup/hugepages.sh @@ -15,6 +15,12 @@ default_huges=$(get_meminfo Hugepagesize) default_huge_nr=/sys/kernel/mm/hugepages/hugepages-${default_huges}kB/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() { local node @@ -104,8 +110,8 @@ verify_nr_hugepages() { # Test cases default_setup() { - # Default HUGEMEM (8G) alloc on node0 - get_test_nr_hugepages $((HUGEMEM * 1024)) 0 + # Default HUGEMEM (2G) alloc on node0 + get_test_nr_hugepages $((2048 * 1024)) 0 setup verify_nr_hugepages } diff --git a/test/spdkcli/common.sh b/test/spdkcli/common.sh index fec6d04973..42fad0858e 100644 --- a/test/spdkcli/common.sh +++ b/test/spdkcli/common.sh @@ -43,3 +43,6 @@ function check_match() { $rootdir/test/app/match/match $testdir/match_files/${MATCH_FILE}.match 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"