Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: "fio@vger.kernel.org" <fio@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>, Vincent Fu <vincentfu@gmail.com>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
Subject: Re: [PATCH v2 8/8] t/zbd: add test cases for zone_reset_threshold option
Date: Tue, 7 Feb 2023 14:06:39 +0000	[thread overview]
Message-ID: <Y+Ja7lDe8gPaeNwL@x1-carbon> (raw)
In-Reply-To: <20230207063739.1661191-9-shinichiro.kawasaki@wdc.com>

On Tue, Feb 07, 2023 at 03:37:39PM +0900, Shin'ichiro Kawasaki wrote:
> The zone_reset_threshold option works for multiple jobs only when the
> jobs have same write range. Add three test cases to confirm that the
> option works for multiple jobs as expected. The first test case checks
> that different write ranges are reported as an error. The second test
> case checks that multiple write jobs work when they have same write
> range. The third test case checks that a read job and a write job work
> when they have different IO ranges.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
>  t/zbd/test-zbd-support | 56 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 56 insertions(+)
> 
> diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support
> index c32953c4..893aff3c 100755
> --- a/t/zbd/test-zbd-support
> +++ b/t/zbd/test-zbd-support
> @@ -1305,6 +1305,62 @@ test60() {
>  	grep -q 'not support experimental verify' "${logfile}.${test_number}"
>  }
>  
> +# Test fio errors out zone_reset_threshold option for multiple jobs with
> +# different write ranges.
> +test61() {
> +	run_fio_on_seq "$(ioengine "psync")" --rw=write --size="$zone_size" \
> +		       --numjobs=2 --offset_increment="$zone_size" \
> +		       --zone_reset_threshold=0.1 --zone_reset_frequency=1 \
> +		       --exitall_on_error=1 \
> +		       >> "${logfile}.${test_number}" 2>&1 && return 1
> +	grep -q 'different write ranges' "${logfile}.${test_number}"
> +}
> +
> +# Test zone_reset_threshold option works for multiple jobs with same write
> +# range.
> +test62() {
> +	local bs loops=2 size=$((zone_size))
> +
> +	[ -n "$is_zbd" ] && reset_zone "$dev" -1
> +
> +	# Two jobs write to single zone twice. Reset zone happens at next write
> +	# after half of the zone gets filled. So 2 * 2 * 2 - 1 = 7 times zone
> +	# resets are expected.
> +	bs=$(min $((256*1024)) $((zone_size / 4)))
> +	run_fio_on_seq "$(ioengine "psync")" --rw=write --bs="$bs" \
> +		       --size=$size --loops=$loops --numjobs=2 \
> +		       --zone_reset_frequency=1 --zone_reset_threshold=.5 \
> +		       --group_reporting=1 \
> +		       >> "${logfile}.${test_number}" 2>&1 || return $?
> +	check_written $((size * loops * 2)) || return $?
> +	check_reset_count -eq 7 || return $?
> +}
> +
> +# Test zone_reset_threshold option works for a read job and a write job with
> +# different IO range.
> +test63() {
> +	local bs loops=2 size=$((zone_size)) off1 off2
> +
> +	[ -n "$is_zbd" ] && reset_zone "$dev" -1
> +
> +	off1=$((first_sequential_zone_sector * 512))
> +	off2=$((off1 + zone_size))
> +	bs=$(min $((256*1024)) $((zone_size / 4)))
> +
> +	# One job writes to single zone twice. Reset zone happens at next write
> +	# after half of the zone gets filled. So 2 * 2 - 1 = 3 times zone resets
> +	# are expected.
> +	run_fio "$(ioengine "psync")" --bs="$bs" --size=$size --loops=$loops \
> +		--filename="$dev" --group_reporting=1 \
> +		--zonemode=zbd --zonesize="$zone_size" --direct=1 \
> +		--zone_reset_frequency=1 --zone_reset_threshold=.5 \
> +		--name=r --rw=read --offset=$off1 "${job_var_opts[@]}" \
> +		--name=w --rw=write --offset=$off2 "${job_var_opts[@]}" \
> +		       >> "${logfile}.${test_number}" 2>&1 || return $?
> +	check_written $((size * loops)) || return $?
> +	check_reset_count -eq 3 || return $?
> +}
> +
>  SECONDS=0
>  tests=()
>  dynamic_analyzer=()
> -- 
> 2.38.1
> 

Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>

      reply	other threads:[~2023-02-07 14:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  6:37 [PATCH v2 0/8] zbd: fix 'sectors with data' and zone_reset_threshold accounting issues Shin'ichiro Kawasaki
2023-02-07  6:37 ` [PATCH v2 1/8] zbd: refer file->last_start[] instead of sectors with data accounting Shin'ichiro Kawasaki
2023-02-07 14:05   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 2/8] zbd: remove CHECK_SWD feature Shin'ichiro Kawasaki
2023-02-07 14:05   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 3/8] zbd: rename the accounting 'sectors with data' to 'valid data bytes' Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 4/8] doc: fix unit of zone_reset_threshold and relation to other option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 5/8] zbd: account valid data bytes only for zone_reset_threshold option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 6/8] zbd: check write ranges " Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-08  4:59     ` Shinichiro Kawasaki
2023-02-07  6:37 ` [PATCH v2 7/8] zbd: initialize valid data bytes accounting at file set up Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-08  5:03     ` Shinichiro Kawasaki
2023-02-08  8:30       ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 8/8] t/zbd: add test cases for zone_reset_threshold option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+Ja7lDe8gPaeNwL@x1-carbon \
    --to=niklas.cassel@wdc.com \
    --cc=Dmitry.Fomichev@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=fio@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=vincentfu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox