public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: kernel-team@fb.com, linux-block@vger.kernel.org, osandov@fb.com
Subject: Re: [PATCH] blktests: test turning wbt on and off
Date: Tue, 18 Dec 2018 16:46:33 -0800	[thread overview]
Message-ID: <20181219004633.GD12683@vader> (raw)
In-Reply-To: <20181212215853.29855-1-josef@toxicpanda.com>

On Wed, Dec 12, 2018 at 04:58:53PM -0500, Josef Bacik wrote:
> There have been a few issues with turning wbt on and off while IO is in
> flight, so add a test that just does some random rw IO and has a
> background thread that toggles wbt on and off.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>  tests/block/027     | 47 +++++++++++++++++++++++++++++++++++++++++++++++
>  tests/block/027.out |  2 ++
>  2 files changed, 49 insertions(+)
>  create mode 100755 tests/block/027
>  create mode 100644 tests/block/027.out
> 
> diff --git a/tests/block/027 b/tests/block/027
> new file mode 100755
> index 000000000000..dce6431172a8
> --- /dev/null
> +++ b/tests/block/027
> @@ -0,0 +1,47 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-3.0+
> +# Copyright (C) 2018 Josef Bacik
> +#
> +# Turn wbt on and off in the background while writing to the disk to verify
> +# there's no races in the inflight counter manipulation
> +
> +. tests/block/rc
> +
> +DESCRIPTION="run a read workload and write workload together with wbt"
> +
> +requires() {
> +	_have_fio && _have_program jq

This test doesn't use jq.

> +}
> +
> +device_requires() {
> +	_test_dev_supports_wbt
> +}
> +
> +toggle_wbt() {
> +	while true
> +	do
> +		_test_dev_queue_set wbt_lat_usec 0
> +		sleep 1
> +		_test_dev_queue_set wbt_lat_usec 1
> +		sleep 1			
Trailing whitespace.   ^^^^^^^^^^^^^^^^^

> +	done
> +}
> +
> +test_device() {

Since this is entirely in the block layer, this test doesn't seem like
it needs a real device. Can it use null_blk instead? See block/006 for
an example.

> +	echo "Running ${TEST_NAME}"
> +
> +	local wbt_setting toggle_pid
> +	wbt_setting=$(_test_dev_queue_get wbt_lat_usec)
> +
> +	(toggle_wbt &)
> +	toggle_pid=$!
> +
> +	_run_fio --name randrw --numjobs=8 --runtime=30 --randseed=12345 \
> +		--ioengine=psync --readwrite=randrw --filename="$TEST_DEV"

If you leave off --runtime=30 here, _run_fio will automatically use the
configured TIMEOUT, and you can make this a TIMED test (i.e., set
TIMED=1 after DESCRIPTION=).

> +	kill $toggle_pid > /dev/null 2>&1
> +	wait
> +	_test_dev_queue_set wbt_lat_usec "$wbt_setting"
> +
> +	echo "Test complete"
> +}
> diff --git a/tests/block/027.out b/tests/block/027.out
> new file mode 100644
> index 000000000000..b03498fbc763
> --- /dev/null
> +++ b/tests/block/027.out
> @@ -0,0 +1,2 @@
> +Running block/027
> +Test complete
> -- 
> 2.14.3
> 

      reply	other threads:[~2018-12-19  0:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 21:58 [PATCH] blktests: test turning wbt on and off Josef Bacik
2018-12-19  0:46 ` Omar Sandoval [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=20181219004633.GD12683@vader \
    --to=osandov@osandov.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.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