From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@meta.com>,
axboe@kernel.dk, linux-block@vger.kernel.org,
tom.leiming@gmail.com
Subject: Re: [PATCHv3] blk-mq: pop cached request if it is usable
Date: Fri, 22 May 2026 06:23:20 -0600 [thread overview]
Message-ID: <ahBKuBp11OE7YTth@kbusch-mbp> (raw)
In-Reply-To: <20260522090340.GA7331@lst.de>
On Fri, May 22, 2026 at 11:03:40AM +0200, Christoph Hellwig wrote:
> > @@ -3257,12 +3243,10 @@ void blk_mq_submit_bio(struct bio *bio)
> > return;
> >
> > queue_exit:
> > - /*
> > - * Don't drop the queue reference if we were trying to use a cached
> > - * request and thus didn't acquire one.
> > - */
> > if (!rq)
> > blk_queue_exit(q);
> > + else
> > + blk_mq_free_request(rq);
> > }
>
> I think keeping a comment here would be nice, a would be avoid
> the inversion of the condition for a trivial if/else.
>
> But on a higher level, I really think you should add it back to the
> batch list here, otherwise we're doing lots of roundtrips through
> blk_mq_free_request for trivially mergable sequential I/O.
That gets compicated when we did sleep. This request may be the last
reference that's holding up a freeze. We really want to re-enter the
queue in that case because the driver is trying to change the queue
limits. Unless this is measurably harming perforamnce, it's a corner
case that's just easier to not think about.
prev parent reply other threads:[~2026-05-22 12:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 19:02 [PATCHv3] blk-mq: pop cached request if it is usable Keith Busch
2026-05-21 19:05 ` Jens Axboe
2026-05-21 19:05 ` Jens Axboe
2026-05-21 23:33 ` Ming Lei
2026-05-22 1:44 ` Keith Busch
2026-05-22 4:12 ` Ming Lei
2026-05-22 22:08 ` Keith Busch
2026-05-22 22:55 ` Keith Busch
2026-05-23 13:56 ` Jens Axboe
2026-05-22 9:03 ` Christoph Hellwig
2026-05-22 12:23 ` Keith Busch [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=ahBKuBp11OE7YTth@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@meta.com \
--cc=linux-block@vger.kernel.org \
--cc=tom.leiming@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 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.