public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "hch@infradead.org" <hch@infradead.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"axboe@fb.com" <axboe@fb.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tom81094@gmail.com" <tom81094@gmail.com>,
	"paolo.valente@linaro.org" <paolo.valente@linaro.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"oleksandr@natalenko.name" <oleksandr@natalenko.name>,
	"john.garry@huawei.com" <john.garry@huawei.com>,
	"osandov@fb.com" <osandov@fb.com>,
	"loberman@redhat.com" <loberman@redhat.com>
Subject: Re: [PATCH V9 6/7] SCSI: allow to pass null rq to scsi_prep_state_check()
Date: Sat, 14 Oct 2017 16:06:05 +0800	[thread overview]
Message-ID: <20171014080604.GA31736@ming.t460p> (raw)
In-Reply-To: <1507936571.13345.51.camel@wdc.com>

On Fri, Oct 13, 2017 at 11:16:12PM +0000, Bart Van Assche wrote:
> On Sat, 2017-10-14 at 02:05 +0800, Ming Lei wrote:
> > In the following patch, we will implement scsi_get_budget()
> > which need to call scsi_prep_state_check() when rq isn't
> > dequeued yet.
> 
> My understanding is that this change is only needed because scsi_mq_get_budget()
> calls scsi_prep_state_check() with the req argument set to NULL. Since
> scsi_prep_state_check() tests for sdev states other than SDEV_RUNNING and since
> the purpose of this series is to optimize performance for the case SDEV_RUNNING
> I'm not sure it's a good idea to make scsi_mq_get_budget() call
> scsi_prep_state_check(). And if scsi_mq_get_budget() wouldn't call
> scsi_prep_state_check() then this patch is not necessary.

The purpose is that I don't want to change the current SCSI logic of
queuing request.

For example, if sdev state becomes OFFLINE or DEL, the current
logic is to fail the request immediately. If the state isn't checked
in scsi_mq_get_budget(), we have to try to obtain budget first,
if it isn't available in the state of OFFLINE of DEL, there might be
risk of I/O hang.

So I suggest to check the state in scsi_mq_get_budget(), just like
what the current scsi_queue_rq() does.

-- 
Ming

  reply	other threads:[~2017-10-14  8:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 18:05 [PATCH V9 0/7] blk-mq-sched: improve sequential I/O performance Ming Lei
2017-10-13 18:05 ` [PATCH V9 1/7] blk-mq-sched: dispatch from scheduler only after progress is made on ->dispatch Ming Lei
2017-10-13 18:05 ` [PATCH V9 2/7] blk-mq-sched: move actual dispatching into one helper Ming Lei
2017-10-13 18:05 ` [PATCH V9 3/7] sbitmap: introduce __sbitmap_for_each_set() Ming Lei
2017-10-13 18:05 ` [PATCH V9 4/7] blk-mq: introduce .get_budget and .put_budget in blk_mq_ops Ming Lei
2017-10-13 23:43   ` Bart Van Assche
2017-10-14  7:34     ` Ming Lei
2017-10-13 18:05 ` [PATCH V9 5/7] blk-mq-sched: improve dispatching from sw queue Ming Lei
2017-10-13 18:05 ` [PATCH V9 6/7] SCSI: allow to pass null rq to scsi_prep_state_check() Ming Lei
2017-10-13 23:16   ` Bart Van Assche
2017-10-14  8:06     ` Ming Lei [this message]
2017-10-13 18:05 ` [PATCH V9 7/7] SCSI: implement .get_budget and .put_budget for blk-mq Ming Lei
2017-10-13 19:08 ` [PATCH V9 0/7] blk-mq-sched: improve sequential I/O performance Jens Axboe
2017-10-13 19:21   ` Jens Axboe
2017-10-13 20:23     ` Jens Axboe
2017-10-14  5:23       ` Ming Lei
2017-10-14  7:10       ` Ming Lei

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=20171014080604.GA31736@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=Bart.VanAssche@wdc.com \
    --cc=axboe@fb.com \
    --cc=hch@infradead.org \
    --cc=john.garry@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    --cc=oleksandr@natalenko.name \
    --cc=osandov@fb.com \
    --cc=paolo.valente@linaro.org \
    --cc=tom81094@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