From 757eddeb59bdd5b7a6a07cd4b4721728d13f847b Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Thu, 23 Jul 2020 15:01:58 +0200 Subject: [PATCH] test/vhost: add option for fio gtod_reduce Enable gtod_reduce fio option on demand for better IOPS/BW results at cost of reducing latency measurements. Signed-off-by: Karol Latecki Change-Id: I0511a5fdc09bb20b5a769ad55f2306b87e5d2dde Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3502 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- test/vhost/common.sh | 7 +++++++ test/vhost/perf_bench/vhost_perf.sh | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/vhost/common.sh b/test/vhost/common.sh index 2d1a142f6..33c8e0953 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -1049,6 +1049,7 @@ function run_fio() { local run_plugin_mode=false local fio_start_cmd local fio_output_format="normal" + local fio_gtod_reduce=false local wait_for_fio=true for arg in "$@"; do @@ -1069,6 +1070,7 @@ function run_fio() { --json) fio_output_format="json" ;; --hide-results) hide_results=true ;; --no-wait-for-fio) wait_for_fio=false ;; + --gtod-reduce) fio_gtod_reduce=true ;; *) error "Invalid argument '$arg'" return 1 @@ -1103,6 +1105,11 @@ function run_fio() { local vmdisks=${vm#*:} sed "s@filename=@filename=$vmdisks@" $job_file | vm_exec $vm_num "cat > /root/$job_fname" + + if $fio_gtod_reduce; then + vm_exec $vm_num "echo 'gtod_reduce=1' >> /root/$job_fname" + fi + vm_exec $vm_num cat /root/$job_fname if $run_server_mode; then diff --git a/test/vhost/perf_bench/vhost_perf.sh b/test/vhost/perf_bench/vhost_perf.sh index 6b8f67d30..98c6a8e3c 100755 --- a/test/vhost/perf_bench/vhost_perf.sh +++ b/test/vhost/perf_bench/vhost_perf.sh @@ -25,6 +25,7 @@ wwpn_prefix="naa.5001405bc6498" packed_ring=false fio_iterations=1 +fio_gtod="" precond_fio_bin=$CONFIG_FIO_SOURCE_DIR/fio disk_map="" @@ -48,6 +49,7 @@ function usage() { echo " of binary is recommended." echo " --fio-jobs=PATH Comma separated list of fio config files to use for test." echo " --fio-iterations=INT Number of times to run specified workload." + echo " --fio-gtod-reduce Enable fio gtod_reduce option in test." echo " --vm-memory=INT Amount of RAM memory (in MB) to pass to a single VM." echo " Default: 2048 MB" echo " --vm-image=PATH OS image to use for running the VMs." @@ -161,6 +163,7 @@ while getopts 'xh-:' optchar; do fio-bin=*) fio_bin="--fio-bin=${OPTARG#*=}" ;; fio-jobs=*) fio_jobs="${OPTARG#*=}" ;; fio-iterations=*) fio_iterations="${OPTARG#*=}" ;; + fio-gtod-reduce) fio_gtod="--gtod-reduce" ;; vm-memory=*) vm_memory="${OPTARG#*=}" ;; vm-image=*) VM_IMAGE="${OPTARG#*=}" ;; vm-sar-enable) vm_sar_enable=true ;; @@ -411,7 +414,7 @@ for fio_job in ${fio_jobs//,/ }; do fio_log_fname="${fio_job_fname%%.*}.log" for i in $(seq 1 $fio_iterations); do echo "Running FIO iteration $i for $fio_job_fname" - run_fio $fio_bin --hide-results --job-file="$fio_job" --out="$VHOST_DIR/fio_results" --json $fio_disks & + run_fio $fio_bin --hide-results --job-file="$fio_job" --out="$VHOST_DIR/fio_results" --json $fio_disks $fio_gtod & fio_pid=$! if $host_sar_enable || $vm_sar_enable; then