FTL: Add compaction tests

Compaction allows for writing to 100% of the exposed address space

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I0860730299249e4369fac33fdab5fbd7ff91c1da
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13339
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Kozlowski Mateusz 2022-06-03 13:38:40 +02:00 committed by Ben Walker
parent 19613862ae
commit 8ffe1a75f9
9 changed files with 136 additions and 1 deletions

View File

@ -4,6 +4,7 @@
ftl_dirty_shutdown
ftl_fio_basic
ftl_fio_extended
ftl_fio_nightly
ftl_restore_nv_cache
ftl_bdevperf
ftl_bdevperf_append

34
test/ftl/bdevperf.sh Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $testdir/common.sh
tests=('-q 1 -w randwrite -t 4 -o 69632' '-q 128 -w randwrite -t 4 -o 4096' '-q 128 -w verify -t 4 -o 4096')
device=$1
cache_device=$2
use_append=$3
rpc_py=$rootdir/scripts/rpc.py
timeout=240
for ((i = 0; i < ${#tests[@]}; i++)); do
timing_enter "${tests[$i]}"
"$rootdir/test/bdev/bdevperf/bdevperf" -z -T ftl0 ${tests[$i]} &
bdevperf_pid=$!
trap 'killprocess $bdevperf_pid; exit 1' SIGINT SIGTERM EXIT
waitforlisten $bdevperf_pid
split_bdev=$(create_base_bdev nvme0 $device $((1024 * 101)))
nv_cache=$(create_nv_cache_bdev nvc0 $cache_device $split_bdev)
$rpc_py -t $timeout bdev_ftl_create -b ftl0 -d $split_bdev $use_append -c $nv_cache
$rootdir/test/bdev/bdevperf/bdevperf.py perform_tests
$rpc_py bdev_ftl_delete -b ftl0
$rpc_py bdev_nvme_detach_controller nvme0
killprocess $bdevperf_pid
trap - SIGINT SIGTERM EXIT
timing_exit "${tests[$i]}"
done

View File

@ -0,0 +1,15 @@
[drive_prep]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
thread=1
direct=1
buffered=0
size=100%
randrepeat=0
norandommap
bs=128k
iodepth=128
numjobs=1
rw=write

View File

@ -0,0 +1,20 @@
[global]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
direct=1
thread=1
buffered=0
size=100%
randrepeat=0
time_based
norandommap
[test]
stonewall
bs=4k
numjobs=4
rw=randrw
rwmixread=70
iodepth=32
runtime=1200

View File

@ -0,0 +1,20 @@
[global]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
thread=1
direct=1
iodepth=128
rw=randwrite
verify=crc32c
do_verify=1
verify_dump=0
verify_state_save=0
verify_fatal=1
bs=4k
random_distribution=normal
serialize_overlap=1
[test]
io_size=64G
numjobs=1

View File

@ -0,0 +1,21 @@
[global]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
thread=1
direct=1
iodepth=256
rw=randwrite
verify=crc32c
do_verify=1
verify_dump=0
verify_state_save=0
verify_fatal=1
bs=4k
random_distribution=normal
serialize_overlap=1
size=100%
[test]
io_size=1000GiB
numjobs=1

View File

@ -0,0 +1,18 @@
[global]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
direct=1
thread=1
buffered=0
size=100%
randrepeat=0
time_based
norandommap
[test]
bs=4k
numjobs=1
rw=randwrite
iodepth=64
runtime=1200

View File

@ -7,7 +7,8 @@ source $testdir/common.sh
declare -A suite
suite['basic']='randw-verify randw-verify-j2 randw-verify-depth128'
suite['extended']='randw-verify-qd2048-ext randr'
suite['extended']='drive-prep randw-verify-qd128-ext randw-verify-qd2048-ext randw randr randrw'
suite['nightly']='drive-prep randw-verify-qd256-nght randw-verify-qd256-nght randw-verify-qd256-nght'
rpc_py=$rootdir/scripts/rpc.py

View File

@ -68,8 +68,13 @@ fi
if [[ -z $SPDK_TEST_FTL_NIGHTLY ]]; then
run_test "ftl_fio_basic" $testdir/fio.sh $device $nv_cache basic
run_test "ftl_bdevperf" $testdir/bdevperf.sh $device $nv_cache
fi
if [ $SPDK_TEST_FTL_EXTENDED -eq 1 ]; then
run_test "ftl_fio_extended" $testdir/fio.sh $device $nv_cache extended
fi
if [ $SPDK_TEST_FTL_NIGHTLY -eq 1 ]; then
run_test "ftl_fio_nightly" $testdir/fio.sh $device $nv_cache nightly
fi