test/nvme-perf: refactor preconditing step

Move all related steps to common.sh/preconditioning() function
so that everything is in one place.

Change-Id: I253a185a5c16e9ba31c84aa945f6c3033f80d53f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479815
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: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Karol Latecki 2020-01-08 13:40:48 +01:00 committed by Tomasz Zawadzki
parent b5069cd01d
commit 73d398dd29
2 changed files with 9 additions and 9 deletions

View File

@ -201,25 +201,28 @@ function create_fio_config(){
fi
}
function preconditioning(){
function preconditioning() {
local dev_name=""
local filename=""
local i
sed -i -e "\$a[preconditioning]" $BASE_DIR/config.fio
local nvme_list
HUGEMEM=8192 $ROOT_DIR/scripts/setup.sh
cp $BASE_DIR/config.fio.tmp $BASE_DIR/config.fio
echo "[Preconditioning]" >> $BASE_DIR/config.fio
# Generate filename argument for FIO.
# We only want to target NVMes not bound to nvme driver.
# If they're still bound to nvme that means they were skipped by
# setup.sh on purpose.
local nvme_list
nvme_list=$(get_disks nvme)
for nvme in $nvme_list; do
dev_name='trtype=PCIe traddr='${nvme//:/.}' ns=1'
filename+=$(printf %s":" "$dev_name")
done
echo "** Preconditioning disks, this can take a while, depending on the size of disks."
run_spdk_nvme_fio "nvme" --filename="$filename" --size=100% --loops=2 --bs=1M\
--rw=write --iodepth=32
run_spdk_nvme_fio "nvme" --filename="$filename" --size=100% --loops=2 --bs=1M \
--rw=write --iodepth=32 --output-format=normal
rm -f $BASE_DIR/config.fio
}
function get_results(){

View File

@ -41,10 +41,7 @@ NO_CORES_ARRAY=($CORES)
NO_CORES=${#NO_CORES_ARRAY[@]}
if $PRECONDITIONING; then
HUGEMEM=8192 $ROOT_DIR/scripts/setup.sh
cp $BASE_DIR/config.fio.tmp $BASE_DIR/config.fio
preconditioning
rm -f $BASE_DIR/config.fio
fi
#Kernel Classic Polling ioengine parameters