From 227428c3a4f5b5a2ab8d1865c92405688ddff6af Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 18 Jun 2021 12:28:21 +0200 Subject: [PATCH] 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 Change-Id: Ie958c518c7ed702b068c7fc9042183fdf41aa816 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8436 Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Paul Luse Reviewed-by: Jim Harris Reviewed-by: Aleksey Marchuk --- autotest.sh | 5 ----- test/common/autotest_common.sh | 10 ++++++++-- test/setup/hugepages.sh | 10 ++++++++-- test/spdkcli/common.sh | 3 +++ 4 files changed, 19 insertions(+), 9 deletions(-) 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"