Commit 7bb8a30d authored by Konrad Sztyber's avatar Konrad Sztyber
Browse files

test/nvmf: try to make reactors more busy in interrupt test



This test verifies that reactors are idle when there's no IO and that
they're idle when handling IO.  The latter check can be a problem,
because the business of a core when handling IOs varies and can never
reach the threshold that we use to consider a core to be busy.

To make that second check more reliable, let's do a couple of things:
increase queue depth to 256 and decrease busy threshold to 30.  Also,
while here, use double parenthesis for arithmetic comparisons.

Fixes: #3520

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2937b46471d523bb496e7b3878f43c541047adaf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24827


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent a9e1852d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ function reactor_is_busy_or_idle() {
	local pid=$1
	local idx=$2
	local state=$3
	local busy_threshold=${BUSY_THRESHOLD:-65}
	local idle_threshold=${IDLE_THRESHOLD:-30}

	if [[ $state != "busy" ]] && [[ $state != "idle" ]]; then
		return 1
@@ -25,9 +27,9 @@ function reactor_is_busy_or_idle() {
		cpu_rate=$(echo $top_reactor | sed -e 's/^\s*//g' | awk '{print $9}')
		cpu_rate=${cpu_rate%.*}

		if [[ $state = "busy" ]] && [[ $cpu_rate -lt 65 ]]; then
		if [[ $state = "busy" ]] && ((cpu_rate < busy_threshold)); then
			sleep 1
		elif [[ $state = "idle" ]] && [[ $cpu_rate -gt 30 ]]; then
		elif [[ $state = "idle" ]] && ((cpu_rate > idle_threshold)); then
			sleep 1
		else
			return 0
+3 −3
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ nvmftestinit
nvmfappstart -m 0x3
setup_bdev_aio

$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 -q 256
$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 AIO0
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
@@ -26,7 +26,7 @@ done
perf="$SPDK_BIN_DIR/spdk_nvme_perf"

# run traffic
$perf -q 64 -o 4096 -w randrw -M 30 -t 10 -c 0xC \
$perf -q 256 -o 4096 -w randrw -M 30 -t 10 -c 0xC \
	-r "trtype:${TEST_TRANSPORT} adrfam:IPv4 traddr:${NVMF_FIRST_TARGET_IP} trsvcid:${NVMF_PORT} \
subnqn:nqn.2016-06.io.spdk:cnode1" "${NO_HUGE[@]}" &

@@ -34,7 +34,7 @@ perf_pid=$!

# confirm that during load all cpu cores are busy
for i in {0..1}; do
	reactor_is_busy $nvmfpid $i
	BUSY_THRESHOLD=30 reactor_is_busy $nvmfpid $i
done

wait $perf_pid