All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Guangwu Zhang <guazhang@redhat.com>,
	Yu Kuai <yukuai1@huaweicloud.com>
Subject: Re: [PATCH V2 1/2] blk-mq: don't queue plugged passthrough requests into scheduler
Date: Tue, 16 May 2023 08:22:21 +0200	[thread overview]
Message-ID: <20230516062221.GA7325@lst.de> (raw)
In-Reply-To: <20230515144601.52811-2-ming.lei@redhat.com>

On Mon, May 15, 2023 at 10:46:00PM +0800, Ming Lei wrote:
> +		} else if (this_hctx != rq->mq_hctx || this_ctx != rq->mq_ctx ||
> +				pt != blk_rq_is_passthrough(rq)) {

Can your format this as:

		} else if (this_hctx != rq->mq_hctx || this_ctx != rq->mq_ctx ||
			   pt != blk_rq_is_passthrough(rq)) {

for readability?

> +			/*
> +			 * Both passthrough and flush request don't belong to
> +			 * scheduler, but flush request won't be added to plug
> +			 * list, so needn't handle here.
> +			 */
>  			rq_list_add_tail(&requeue_lastp, rq);

This comment confuses the heck out of me.  The check if for passthrough
vs non-passthrough and doesn't involved flush requests at all.

I'd prefer to drop it, and instead comment on passthrough requests
not going to the scheduled below where we actually issue other requests
to the scheduler.

> +	if (pt) {
> +		spin_lock(&this_hctx->lock);
> +		list_splice_tail_init(&list, &this_hctx->dispatch);
> +		spin_unlock(&this_hctx->lock);
> +		blk_mq_run_hw_queue(this_hctx, from_sched);

.. aka here.  But why can't we just use the blk_mq_insert_requests
for this case anyway?

As in just doing a:


-	if (this_hctx->queue->elevator) {
+	if (this_hctx->queue->elevator && !pt) {

?

  reply	other threads:[~2023-05-16  6:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15 14:45 [PATCH V2 0/2] blk-mq: handle passthrough request as really passthrough Ming Lei
2023-05-15 14:46 ` [PATCH V2 1/2] blk-mq: don't queue plugged passthrough requests into scheduler Ming Lei
2023-05-16  6:22   ` Christoph Hellwig [this message]
2023-05-16  8:10     ` Ming Lei
2023-05-17  7:20       ` Christoph Hellwig
2023-05-15 14:46 ` [PATCH V2 2/2] blk-mq: make sure elevator callbacks aren't called for passthrough request Ming Lei
2023-05-15 15:52   ` Bart Van Assche
2023-05-15 20:22     ` Keith Busch
2023-05-16  1:20       ` Ming Lei
2023-05-16  6:24         ` Christoph Hellwig
2023-05-16  8:39           ` Ming Lei
2023-05-17  7:22             ` Christoph Hellwig
2023-05-17  8:58               ` Ming Lei
2023-05-16 14:47         ` Keith Busch
2023-05-17  3:26           ` Ming Lei
2023-05-17 18:13             ` Keith Busch
2023-05-18  1:22               ` 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=20230516062221.GA7325@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=guazhang@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=yukuai1@huaweicloud.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.