linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] scsi: core: run queue in case of IO queueing failure
Date: Sun, 19 Jul 2020 19:26:43 -0700	[thread overview]
Message-ID: <e3fdd46a-4d33-cb57-7b2d-68f2cf5d22cc@acm.org> (raw)
In-Reply-To: <20200720013213.GA791101@T590>

On 2020-07-19 18:32, Ming Lei wrote:
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index b9adee0a9266..9798fbffe307 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -564,6 +564,15 @@ static void scsi_mq_uninit_cmd(struct scsi_cmnd *cmd)
>  	scsi_uninit_cmd(cmd);
>  }
>  
> +static void scsi_run_queue_async(struct scsi_device *sdev)
> +{
> +	if (scsi_target(sdev)->single_lun ||
> +	    !list_empty(&sdev->host->starved_list))
> +		kblockd_schedule_work(&sdev->requeue_work);
> +	else
> +		blk_mq_run_hw_queues(sdev->request_queue, true);
> +}
> +
>  /* Returns false when no more bytes to process, true if there are more */
>  static bool scsi_end_request(struct request *req, blk_status_t error,
>  		unsigned int bytes)
> @@ -608,11 +617,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error,
>  
>  	__blk_mq_end_request(req, error);
>  
> -	if (scsi_target(sdev)->single_lun ||
> -	    !list_empty(&sdev->host->starved_list))
> -		kblockd_schedule_work(&sdev->requeue_work);
> -	else
> -		blk_mq_run_hw_queues(q, true);
> +	scsi_run_queue_async(sdev);
>  
>  	percpu_ref_put(&q->q_usage_counter);
>  	return false;
> @@ -1721,6 +1726,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
>  		 */
>  		if (req->rq_flags & RQF_DONTPREP)
>  			scsi_mq_uninit_cmd(cmd);
> +		scsi_run_queue_async(sdev);
>  		break;
>  	}
>  	return ret;

Looks good to me. Feel free to add:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

      reply	other threads:[~2020-07-20  2:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 13:14 [PATCH] scsi: core: run queue in case of IO queueing failure Ming Lei
2020-07-14  0:37 ` Ming Lei
2020-07-17 14:23   ` Ming Lei
2020-07-18 20:22 ` Bart Van Assche
2020-07-20  1:32   ` Ming Lei
2020-07-20  2:26     ` Bart Van Assche [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=e3fdd46a-4d33-cb57-7b2d-68f2cf5d22cc@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@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;
as well as URLs for NNTP newsgroup(s).