public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Ming Lei <ming.lei@redhat.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] scsi: core: run queue in case of IO queueing failure
Date: Sat, 18 Jul 2020 13:22:27 -0700	[thread overview]
Message-ID: <bd3039d4-0c24-ad67-bdfe-85096ad60721@acm.org> (raw)
In-Reply-To: <20200708131405.3346107-1-ming.lei@redhat.com>

On 2020-07-08 06:14, Ming Lei wrote:
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 534b85e87c80..4d7fab9e8af9 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1694,6 +1694,16 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
>  		 */
>  		if (req->rq_flags & RQF_DONTPREP)
>  			scsi_mq_uninit_cmd(cmd);
> +
> +		/*
> +		 * Requests may be held in block layer queue because of
> +		 * resource contention. We usually run queue in normal
> +		 * completion for queuing these requests again. Block layer
> +		 * will finish this failed request simply, run queue in case
> +		 * of IO queueing failure so that requests can get chance to
> +		 * be finished.
> +		 */
> +		scsi_run_queue(q);
>  		break;
>  	}
>  	return ret;

So this patch causes blk_mq_run_hw_queues() to be called synchronously
from inside blk_mq_run_hw_queues()? Wouldn't it be better to avoid such
recursion and to run the queue asynchronously instead of synchronously
from inside scsi_queue_rq()? The following code already exists in
scsi_end_request():

	blk_mq_run_hw_queues(q, true);

Thanks,

Bart.

  parent reply	other threads:[~2020-07-18 20:22 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 [this message]
2020-07-20  1:32   ` Ming Lei
2020-07-20  2:26     ` Bart Van Assche

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=bd3039d4-0c24-ad67-bdfe-85096ad60721@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