All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Omar Sandoval <osandov@osandov.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
	Omar Sandoval <osandov@fb.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
	Ming Lei <ming.lei@redhat.com>,
	Damien Le Moal <Damien.LeMoal@wdc.com>
Subject: Re: [PATCH blktests v2 4/4] Add a test that triggers the blk_mq_realloc_hw_ctxs() error path
Date: Tue, 21 Apr 2020 09:10:46 +0000	[thread overview]
Message-ID: <20200421091045.ykwivjccrzm5hzcy@shindev.dhcp.fujisawa.hgst.com> (raw)
In-Reply-To: <20200421023520.3qhthit7lb6mr45c@shindev.dhcp.fujisawa.hgst.com>

On Apr 21, 2020 / 02:35, Shinichiro Kawasaki wrote:
> On Mar 20, 2020 / 14:42, Omar Sandoval wrote:
> > On Sun, Mar 15, 2020 at 03:13:20PM -0700, Bart Van Assche wrote:
> > > Add a test that triggers the code touched by commit d0930bb8f46b ("blk-mq:
> > > Fix a recently introduced regression in blk_mq_realloc_hw_ctxs()"). This
> > > test only runs if a recently added fault injection feature is available,
> > > namely commit 596444e75705 ("null_blk: Add support for init_hctx() fault
> > > injection").
> > > 
> > > Cc: Ming Lei <ming.lei@redhat.com>
> > > Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> > > ---
> > >  tests/block/030     | 42 ++++++++++++++++++++++++++++++++++++++++++
> > >  tests/block/030.out |  1 +
> > >  2 files changed, 43 insertions(+)
> > >  create mode 100755 tests/block/030
> > >  create mode 100644 tests/block/030.out
> > > 
> > > diff --git a/tests/block/030 b/tests/block/030
> > > new file mode 100755
> > > index 000000000000..861c85c27f09
> > > --- /dev/null
> > > +++ b/tests/block/030
> > > @@ -0,0 +1,42 @@
> > > +#!/bin/bash
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +# Copyright 2020 Google LLC
> > > +#
> > > +# Trigger the blk_mq_realloc_hw_ctxs() error path.
> > > +
> > > +. tests/block/rc
> > > +. common/null_blk
> > > +
> > > +DESCRIPTION="trigger the blk_mq_realloc_hw_ctxs() error path"
> > > +QUICK=1
> > > +
> > > +requires() {
> > > +	_have_null_blk || return $?
> > > +	_have_module_param null_blk init_hctx || return $?
> > > +}
> > > +
> > > +test() {
> > > +	local i sq=/sys/kernel/config/nullb/nullb0/submit_queues
> > > +
> > > +	: "${TIMEOUT:=30}"
> > > +	if ! _init_null_blk nr_devices=0 queue_mode=2 "init_hctx=$(nproc),100,0,0"; then
> > > +		echo "Loading null_blk failed"
> > > +		return 1
> > > +	fi
> > > +	if ! _configure_null_blk nullb0 completion_nsec=0 blocksize=512 size=16\
> > > +	     submit_queues="$(nproc)" memory_backed=1 power=1; then
> > > +		echo "Configuring null_blk failed"
> > > +		return 1
> > > +	fi
> > > +	if { echo "$(<"$sq")" >$sq; } 2>/dev/null; then
> > > +		for ((i=0;i<100;i++)); do
> > > +			echo 1 >$sq
> > > +			nproc >$sq
> > > +		done
> > > +	else
> > > +		echo "Skipping test because $sq cannot be modified" >>"$FULL"
> > 
> > I just pushed the support for allowing skipping from the middle of a
> > test, so now you could make this
> > 
> > 	SKIP_REASON="Skipping test because $sq cannot be modified"
> >
> 
> Hi Omar,
> 
> I noticed the commit cd11d001fe86 ("Support skipping tests from
> test{,_device}()") have side effects to some test cases. The unexpected run
> result "not run" is reported to test cases as follows:
> 
> - block/005 ... for non-rotational drives such as nullb
> - zbd/00[1-5]
> - zbd/007   ... for dm-linear device
> 
> Some helper functions _test_dev_is_rotational, _test_dev_is_partition or so
> are called within test_device() context, and left SKIP_REASON with values. It
> resulted in the "not run" result.
> 
> To fix this, I can think of two approaches. One is to unset SKIP_REASON after
> calling _test_dev_is_X helper functions within the test cases affected. This fix
> is straight forward but it will require similar care for future test case
> additions and changes. The other approach is to flag the test cases which judge
> skip during test run. For example, SKIP_DURING_RUN=1 can be defined in those
> test cases (block/030). The check script validates SKIP_REASON only if the test
> case is flagged. This second approach looks less costly for me.
> 
> Please let me know your thoughts about the fix approach. Thanks!

Now I found that Klaus Jensen already reported this and posted his fix patch.
My report was not necessary. Sorry about this noise.

-- 
Best Regards,
Shin'ichiro Kawasaki

      reply	other threads:[~2020-04-21  9:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-15 22:13 [PATCH blktests v2 0/4] Add a test that triggers the blk_mq_realloc_hw_ctxs() error path Bart Van Assche
2020-03-15 22:13 ` [PATCH blktests v2 1/4] Make _exit_null_blk remove all null_blk device instances Bart Van Assche
2020-03-15 23:22   ` Chaitanya Kulkarni
2020-03-16  0:25     ` Bart Van Assche
2020-03-20 20:04   ` Omar Sandoval
2020-03-15 22:13 ` [PATCH blktests v2 2/4] Use _{init,exit}_null_blk instead of open-coding these functions Bart Van Assche
2020-03-15 23:22   ` Chaitanya Kulkarni
2020-03-15 22:13 ` [PATCH blktests v2 3/4] Introduce the function _configure_null_blk() Bart Van Assche
2020-03-15 23:34   ` Chaitanya Kulkarni
2020-03-20 20:16   ` Omar Sandoval
2020-03-15 22:13 ` [PATCH blktests v2 4/4] Add a test that triggers the blk_mq_realloc_hw_ctxs() error path Bart Van Assche
2020-03-15 23:36   ` Chaitanya Kulkarni
2020-03-20 21:42   ` Omar Sandoval
2020-04-21  2:35     ` Shinichiro Kawasaki
2020-04-21  9:10       ` Shinichiro Kawasaki [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=20200421091045.ykwivjccrzm5hzcy@shindev.dhcp.fujisawa.hgst.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@fb.com \
    --cc=osandov@osandov.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.