test/nvme_perf: move fio config generation into one place
Configuration file generation was split into multiple places/functions in scripts. Move it into a single function. "time_based" fio parameter has been moved to fio config template file as it is not configurable. There is still a lot of room for improvement here, because create_fio_config() function uses mixed local variables (as function arguments) and global variables. Change-Id: Ica3717d0d28692d24c861c2d32e729761c5c8647 Signed-off-by: Karol Latecki <karol.latecki@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3345 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
d3e1aa05db
commit
b9150897d9
@ -211,6 +211,34 @@ function create_fio_config() {
|
||||
local disks_per_core=$((disk_no / no_cores))
|
||||
local disks_per_core_mod=$((disk_no % no_cores))
|
||||
|
||||
# SPDK fio plugin supports submitting/completing I/Os to multiple SSDs from a single thread.
|
||||
# Therefore, the per thread queue depth is set to the desired IODEPTH/device X the number of devices per thread.
|
||||
# TODO: Shouldn't this be applicable to running kernel fio tests as well? Because, what's the difference?
|
||||
QD=$IODEPTH
|
||||
if [[ "$PLUGIN" =~ "spdk-plugin" ]] && [[ "$NOIOSCALING" = false ]]; then
|
||||
QD=$((IODEPTH * DISKNO))
|
||||
fi
|
||||
|
||||
# Following part of this function still leverages global variables a lot.
|
||||
# It's a mix of local variables passed as aruments to function with global variables. This is messy.
|
||||
# TODO: Modify this to be consistent with how variables are used here. Aim for using only
|
||||
# local variables to get rid of globals as much as possible.
|
||||
desc="\"Test io_plugin=$PLUGIN Blocksize=${BLK_SIZE} Workload=$RW MIX=${MIX} qd=${IODEPTH}\""
|
||||
cp "$testdir/config.fio.tmp" "$testdir/config.fio"
|
||||
cat <<- EOF >> $testdir/config.fio
|
||||
description=$desc
|
||||
|
||||
rw=$RW
|
||||
rwmixread=$MIX
|
||||
iodepth=$QD
|
||||
bs=$BLK_SIZE
|
||||
runtime=$RUNTIME
|
||||
ramp_time=$RAMP_TIME
|
||||
numjobs=$NUMJOBS
|
||||
log_avg_msec=$SAMPLING_INT
|
||||
|
||||
EOF
|
||||
|
||||
# For kernel dirver, each disk will be alligned with all cpus on the same NUMA node
|
||||
if [[ "$plugin" =~ "kernel" ]]; then
|
||||
for ((i = 0; i < disk_no; i++)); do
|
||||
@ -271,6 +299,9 @@ function create_fio_config() {
|
||||
echo "" >> $testdir/config.fio
|
||||
done
|
||||
fi
|
||||
|
||||
echo "INFO: Generated fio configuration file:"
|
||||
cat $testdir/config.fio
|
||||
}
|
||||
|
||||
function preconditioning() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
[global]
|
||||
thread=1
|
||||
group_reporting=1
|
||||
direct=1
|
||||
thread=1
|
||||
norandommap=1
|
||||
group_reporting=1
|
||||
time_based=1
|
||||
|
@ -212,16 +212,6 @@ fi
|
||||
|
||||
#Run each workolad $REPEAT_NO times
|
||||
for ((j = 0; j < REPEAT_NO; j++)); do
|
||||
cp $testdir/config.fio.tmp $testdir/config.fio
|
||||
echo "" >> $testdir/config.fio
|
||||
#The SPDK fio plugin supports submitting/completing I/Os to multiple SSDs from a single thread.
|
||||
#Therefore, the per thread queue depth is set to the desired IODEPTH/device X the number of devices per thread.
|
||||
if [[ "$PLUGIN" =~ "spdk-plugin" ]] && [[ "$NOIOSCALING" = false ]]; then
|
||||
qd=$((IODEPTH * DISKNO))
|
||||
else
|
||||
qd=$IODEPTH
|
||||
fi
|
||||
|
||||
if [ $PLUGIN = "spdk-perf-bdev" ]; then
|
||||
run_bdevperf > $TMP_RESULT_FILE
|
||||
iops_disks=$((iops_disks + $(get_bdevperf_results iops)))
|
||||
@ -239,23 +229,7 @@ for ((j = 0; j < REPEAT_NO; j++)); do
|
||||
|
||||
cp $TMP_RESULT_FILE $result_dir/perf_results_${MIX}_${PLUGIN}_${NO_CORES}cpus_${DATE}_${k}_disks_${j}.output
|
||||
else
|
||||
desc="Running Test: Blocksize=${BLK_SIZE} Workload=$RW MIX=${MIX} qd=${IODEPTH} io_plugin/driver=$PLUGIN"
|
||||
cat <<- EOF >> $testdir/config.fio
|
||||
rw=$RW
|
||||
rwmixread=$MIX
|
||||
iodepth=$qd
|
||||
bs=$BLK_SIZE
|
||||
runtime=$RUNTIME
|
||||
ramp_time=$RAMP_TIME
|
||||
numjobs=$NUMJOBS
|
||||
time_based=1
|
||||
description=$desc
|
||||
log_avg_msec=$SAMPLING_INT
|
||||
EOF
|
||||
|
||||
create_fio_config $DISKNO $PLUGIN "$DISK_NAMES" "$DISKS_NUMA" "$CORES"
|
||||
echo "USING CONFIG:"
|
||||
cat $testdir/config.fio
|
||||
|
||||
if [[ "$PLUGIN" =~ "spdk-plugin" ]]; then
|
||||
run_spdk_nvme_fio $PLUGIN "--output=$TMP_RESULT_FILE" \
|
||||
|
Loading…
Reference in New Issue
Block a user