From: Omar Sandoval <osandov@osandov.com>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: linux-block@vger.kernel.org, Omar Sandoval <osandov@fb.com>,
Masato Suzuki <masato.suzuki@wdc.com>,
Jens Axboe <axboe@kernel.dk>,
Matias Bjorling <matias.bjorling@wdc.com>,
Hannes Reinecke <hare@suse.de>, Mike Snitzer <snitzer@redhat.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Subject: Re: [PATCH blktests v2 03/16] common: Move set_scheduler() function definition
Date: Wed, 16 Jan 2019 18:18:45 -0800 [thread overview]
Message-ID: <20190117021845.GC25494@vader> (raw)
In-Reply-To: <20190110093725.32675-4-shinichiro.kawasaki@wdc.com>
On Thu, Jan 10, 2019 at 06:37:12PM +0900, Shin'ichiro Kawasaki wrote:
> set_scheduler() function defined in common/multipath-over-rdma is useful
> to set up a specific IO scheduler not only for multipath tests but also
> for zoned block device tests. Move this function to common/rc to allow
> its use in test groups other than multipath.
The preferred way to set the scheduler is:
_test_dev_queue_set scheduler "$scheduler"
This function is in the multipath tests because it was a preexisting
test suite which was merged into blktests.
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
> common/multipath-over-rdma | 24 ------------------------
> common/rc | 24 ++++++++++++++++++++++++
> 2 files changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma
> index 308c9b5..6bea8e4 100644
> --- a/common/multipath-over-rdma
> +++ b/common/multipath-over-rdma
> @@ -275,30 +275,6 @@ mount_configfs() {
> fi
> }
>
> -# Set scheduler of block device $1 to $2.
> -set_scheduler() {
> - local b=$1 p s=$2
> -
> - p=/sys/class/block/$b/queue/scheduler
> - if [ -e "/sys/block/$b/mq" ]; then
> - case "$s" in
> - noop) s=none;;
> - deadline) s=mq-deadline;;
> - bfq) s=bfq;;
> - esac
> - else
> - case "$s" in
> - none) s=noop;;
> - mq-deadline) s=deadline;;
> - bfq-mq) s=bfq;;
> - esac
> - fi
> - if ! echo "$s" > "$p"; then
> - echo "Changing scheduler of $b from $(<"$p") into $s failed"
> - return 1
> - fi
> -}
> -
> # Get a /dev/... path that points at dm device number $1. Set its I/O scheduler
> # to $2 and its timeout to $3. The shell script that includes this file must
> # define a function get_bdev_path() that translates device number $1 into a
> diff --git a/common/rc b/common/rc
> index e628f96..0b99e84 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -222,3 +222,27 @@ _test_dev_is_zoned() {
> fi
> return 0
> }
> +
> +# Set scheduler of block device $1 to $2.
> +set_scheduler() {
> + local b=$1 p s=$2
> +
> + p=/sys/class/block/$b/queue/scheduler
> + if [ -e "/sys/block/$b/mq" ]; then
> + case "$s" in
> + noop) s=none;;
> + deadline) s=mq-deadline;;
> + bfq) s=bfq;;
> + esac
> + else
> + case "$s" in
> + none) s=noop;;
> + mq-deadline) s=deadline;;
> + bfq-mq) s=bfq;;
> + esac
> + fi
> + if ! echo "$s" > "$p"; then
> + echo "Changing scheduler of $b from $(<"$p") into $s failed"
> + return 1
> + fi
> +}
> --
> 2.20.1
>
next prev parent reply other threads:[~2019-01-17 2:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 9:37 [PATCH blktests v2 00/16] Implement zoned block device support Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 01/16] config: Introduce ZONED variable Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 02/16] common: Introduce _test_dev_is_zoned() helper function Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 03/16] common: Move set_scheduler() function definition Shin'ichiro Kawasaki
2019-01-17 2:18 ` Omar Sandoval [this message]
2019-01-17 6:18 ` Shinichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 04/16] common: Introduce _have_fio_zbd_zonemode() helper function Shin'ichiro Kawasaki
2019-01-17 2:22 ` Omar Sandoval
2019-01-17 6:21 ` Shinichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 05/16] block/004: Adjust fio conditions for zoned block device Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 06/16] block/013: Skip for zoned block devices Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 07/16] block/018,024: Skip when ZONED is set Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 08/16] check: Introduce group_exit() function Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 09/16] src: Introduce zbdioctl program Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 10/16] common: Introduce _dd() helper function Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 11/16] tests: Introduce zbd test group Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 12/16] zbd/001: sysfs and ioctl consistency test Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 13/16] zbd/002: report zone test Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 14/16] zbd/003: Test sequential zones reset Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 15/16] zbd/004: Check write split accross sequential zones Shin'ichiro Kawasaki
2019-01-10 9:37 ` [PATCH blktests v2 16/16] zbd/005: Test write ordering Shin'ichiro Kawasaki
2019-01-17 2:16 ` [PATCH blktests v2 00/16] Implement zoned block device support Omar Sandoval
2019-01-17 5:15 ` Chaitanya Kulkarni
2019-01-17 6:06 ` Shinichiro Kawasaki
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=20190117021845.GC25494@vader \
--to=osandov@osandov.com \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=masato.suzuki@wdc.com \
--cc=matias.bjorling@wdc.com \
--cc=osandov@fb.com \
--cc=shinichiro.kawasaki@wdc.com \
--cc=snitzer@redhat.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