public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Jens Axboe <axboe@kernel.dk>,
	"Ewan D . Milne" <emilne@redhat.com>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	Hannes Reinecke <hare@suse.de>,
	Damien Le Moal <damien.lemoal@wdc.com>,
	Long Li <longli@microsoft.com>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH] scsi: core: only re-run queue in scsi_end_request() if device queue is busy
Date: Mon, 18 Nov 2019 15:08:51 +0800	[thread overview]
Message-ID: <20191118070851.GA16717@ming.t460p> (raw)
In-Reply-To: <465632fa-2519-6e44-3a3c-0f81a8e6689e@acm.org>

On Sun, Nov 17, 2019 at 09:30:39PM -0800, Bart Van Assche wrote:
> On 2019-11-17 00:08, Ming Lei wrote:
> > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> > index 379533ce8661..212903d5f43c 100644
> > --- a/drivers/scsi/scsi_lib.c
> > +++ b/drivers/scsi/scsi_lib.c
> > @@ -612,7 +612,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error,
> >  	if (scsi_target(sdev)->single_lun ||
> >  	    !list_empty(&sdev->host->starved_list))
> >  		kblockd_schedule_work(&sdev->requeue_work);
> > -	else
> > +	else if (READ_ONCE(sdev->restart))
> >  		blk_mq_run_hw_queues(q, true);
> >  
> 
> Rerunning the hardware queues is not only necessary after
> scsi_dev_queue_ready() returns false but also after .queuecommand()
> returns SCSI_MLQUEUE_*_BUSY. Can this patch cause queue stalls if
> .queuecommand() returns SCSI_MLQUEUE_*_BUSY?

No, that isn't why blk_mq_run_hw_queues is called in scsi_end_request(),
and you should see that it is just this LUN to be re-run.

Also if .queuecommand() returns any non-zero value, BLK_STS_RESOURCE
will be returned to blk-mq, then blk-mq will cover the re-run.

thanks,
Ming


      reply	other threads:[~2019-11-18  7:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-17  8:08 [PATCH] scsi: core: only re-run queue in scsi_end_request() if device queue is busy Ming Lei
2019-11-18  0:18 ` Damien Le Moal
2019-11-18  0:47   ` Ming Lei
2019-11-18  1:10     ` Damien Le Moal
2019-11-18  2:46   ` Jens Axboe
2019-11-18  5:30 ` Bart Van Assche
2019-11-18  7:08   ` Ming Lei [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=20191118070851.GA16717@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@wdc.com \
    --cc=emilne@redhat.com \
    --cc=hare@suse.de \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=martin.petersen@oracle.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