Commit 227428c3 authored by Michal Berger's avatar Michal Berger Committed by Jim Harris
Browse files

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: default avatarMichal Berger <michalx.berger@intel.com>
Change-Id: Ie958c518c7ed702b068c7fc9042183fdf41aa816
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8436


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent 928db416
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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
+8 −2
Original line number Diff line number Diff line
@@ -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
+8 −2
Original line number Diff line number Diff line
@@ -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
}
+3 −0
Original line number Diff line number Diff line
@@ -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"