Skip to content

Commit

Permalink
t/zbd: add max_active configs to run-tests-against-nullb
Browse files Browse the repository at this point in the history
Introduce several new test device configurations to cover the cases with
max_active_zones is not being zero, i.e. limited. Two group of new
configurations are added, one with max_active_zones == max_open_zones
and the other with max_active_zones > max_open_zones.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20230719105756.553146-14-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
dmitry-fomichev authored and vincentkfu committed Jul 20, 2023
1 parent 7097062 commit caf7ac7
Showing 1 changed file with 188 additions and 6 deletions.
194 changes: 188 additions & 6 deletions t/zbd/run-tests-against-nullb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ configure_nullb()

if ((max_open)); then
echo "${max_open}" > zone_max_open
if ((max_active)); then
if ((!max_act_supported)); then
echo "null_blk does not support active zone counts"
return 2
fi
echo "${max_active}" > zone_max_active
fi
fi
fi

Expand All @@ -97,6 +104,11 @@ show_nullb_config()
echo " $(printf "Zone Capacity: %d MB" ${zone_capacity})"
if ((max_open)); then
echo " $(printf "Max Open: %d Zones" ${max_open})"
if ((max_active)); then
echo " $(printf "Max Active: %d Zones" ${max_active})"
else
echo " Max Active: Unlimited Zones"
fi
else
echo " Max Open: Unlimited Zones"
fi
Expand Down Expand Up @@ -131,6 +143,7 @@ section3()
zone_size=4
zone_capacity=3
max_open=0
max_active=0
}

# Zoned device with mostly sequential zones, ZCAP == ZSIZE, unlimited MaxOpen.
Expand All @@ -140,6 +153,7 @@ section4()
zone_size=1
zone_capacity=1
max_open=0
max_active=0
}

# Zoned device with mostly sequential zones, ZCAP < ZSIZE, unlimited MaxOpen.
Expand All @@ -149,6 +163,7 @@ section5()
zone_size=4
zone_capacity=3
max_open=0
max_active=0
}

# Zoned device with mostly conventional zones, ZCAP == ZSIZE, unlimited MaxOpen.
Expand All @@ -158,6 +173,7 @@ section6()
zone_size=1
zone_capacity=1
max_open=0
max_active=0
}

# Zoned device with mostly conventional zones, ZCAP < ZSIZE, unlimited MaxOpen.
Expand All @@ -168,9 +184,11 @@ section7()
zone_size=4
zone_capacity=3
max_open=0
max_active=0
}

# Zoned device with no conventional zones, ZCAP == ZSIZE, limited MaxOpen.
# Zoned device with no conventional zones, ZCAP == ZSIZE, limited MaxOpen,
# unlimited MaxActive.
section8()
{
dev_size=1024
Expand All @@ -179,49 +197,59 @@ section8()
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=0
}

# Zoned device with no conventional zones, ZCAP < ZSIZE, limited MaxOpen.
# Zoned device with no conventional zones, ZCAP < ZSIZE, limited MaxOpen,
# unlimited MaxActive.
section9()
{
conv_pcnt=0
zone_size=4
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=0
}

# Zoned device with mostly sequential zones, ZCAP == ZSIZE, limited MaxOpen.
# Zoned device with mostly sequential zones, ZCAP == ZSIZE, limited MaxOpen,
# unlimited MaxActive.
section10()
{
conv_pcnt=10
zone_size=1
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=0
}

# Zoned device with mostly sequential zones, ZCAP < ZSIZE, limited MaxOpen.
# Zoned device with mostly sequential zones, ZCAP < ZSIZE, limited MaxOpen,
# unlimited MaxActive.
section11()
{
conv_pcnt=10
zone_size=4
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=0
}

# Zoned device with mostly conventional zones, ZCAP == ZSIZE, limited MaxOpen.
# Zoned device with mostly conventional zones, ZCAP == ZSIZE, limited MaxOpen,
# unlimited MaxActive.
section12()
{
conv_pcnt=66
zone_size=1
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=0
}

# Zoned device with mostly conventional zones, ZCAP < ZSIZE, limited MaxOpen.
# Zoned device with mostly conventional zones, ZCAP < ZSIZE, limited MaxOpen,
# unlimited MaxActive.
section13()
{
dev_size=2048
Expand All @@ -230,6 +258,155 @@ section13()
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=0
}

# Zoned device with no conventional zones, ZCAP == ZSIZE, limited MaxOpen,
# MaxActive == MaxOpen.
section14()
{
dev_size=1024
conv_pcnt=0
zone_size=1
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=${set_max_open}
}

# Zoned device with no conventional zones, ZCAP < ZSIZE, limited MaxOpen,
# MaxActive == MaxOpen.
section15()
{
conv_pcnt=0
zone_size=4
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=${set_max_open}
}

# Zoned device with mostly sequential zones, ZCAP == ZSIZE, limited MaxOpen,
# MaxActive == MaxOpen.
section16()
{
conv_pcnt=10
zone_size=1
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=${set_max_open}
}

# Zoned device with mostly sequential zones, ZCAP < ZSIZE, limited MaxOpen,
# MaxActive == MaxOpen.
section17()
{
conv_pcnt=10
zone_size=4
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=${set_max_open}
}

# Zoned device with mostly conventional zones, ZCAP == ZSIZE, limited MaxOpen,
# MaxActive == MaxOpen.
section18()
{
conv_pcnt=66
zone_size=1
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=${set_max_open}
}

# Zoned device with mostly conventional zones, ZCAP < ZSIZE, limited MaxOpen,
# MaxActive == MaxOpen.
section19()
{
dev_size=2048
conv_pcnt=66
zone_size=4
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=${set_max_open}
}

# Zoned device with no conventional zones, ZCAP == ZSIZE, limited MaxOpen,
# MaxActive > MaxOpen.
section20()
{
dev_size=1024
conv_pcnt=0
zone_size=1
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=$((set_max_open+set_extra_max_active))
}

# Zoned device with no conventional zones, ZCAP < ZSIZE, limited MaxOpen,
# MaxActive > MaxOpen.
section21()
{
conv_pcnt=0
zone_size=4
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=$((set_max_open+set_extra_max_active))
}

# Zoned device with mostly sequential zones, ZCAP == ZSIZE, limited MaxOpen,
# MaxActive > MaxOpen.
section22()
{
conv_pcnt=10
zone_size=1
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=$((set_max_open+set_extra_max_active))
}

# Zoned device with mostly sequential zones, ZCAP < ZSIZE, limited MaxOpen,
# MaxActive > MaxOpen.
section23()
{
conv_pcnt=10
zone_size=4
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=$((set_max_open+set_extra_max_active))
}

# Zoned device with mostly conventional zones, ZCAP == ZSIZE, limited MaxOpen,
# MaxActive > MaxOpen.
section24()
{
conv_pcnt=66
zone_size=1
zone_capacity=1
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=$((set_max_open+set_extra_max_active))
}

# Zoned device with mostly conventional zones, ZCAP < ZSIZE, limited MaxOpen,
# MaxActive > MaxOpen.
section25()
{
dev_size=2048
conv_pcnt=66
zone_size=4
zone_capacity=3
max_open=${set_max_open}
zbd_test_opts+=("-o ${max_open}")
max_active=$((set_max_open+set_extra_max_active))
}

#
Expand All @@ -240,10 +417,12 @@ scriptdir="$(cd "$(dirname "$0")" && pwd)"
sections=()
zcap_supported=1
conv_supported=1
max_act_supported=1
list_only=0
dev_size=1024
dev_blocksize=4096
set_max_open=8
set_extra_max_active=2
zbd_test_opts=()
num_of_runs=1
test_case=0
Expand Down Expand Up @@ -283,6 +462,9 @@ fi
if ! cat /sys/kernel/config/nullb/features | grep -q zone_nr_conv; then
conv_supported=0
fi
if ! cat /sys/kernel/config/nullb/features | grep -q zone_max_active; then
max_act_supported=0
fi

rc=0
test_rc=0
Expand Down

0 comments on commit caf7ac7

Please sign in to comment.