Linux block layer
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] block: treat poll queue enter similarly to timeouts
Date: Fri, 20 Jan 2023 09:11:38 -0700	[thread overview]
Message-ID: <Y8q9OvUjPxSzif/j@kbusch-mbp> (raw)
In-Reply-To: <9590debc-ce87-f044-b687-59b551c24219@kernel.dk>

On Fri, Jan 20, 2023 at 07:59:34AM -0700, Jens Axboe wrote:
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -869,7 +869,16 @@ int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags)
>  	 */
>  	blk_flush_plug(current->plug, false);
>  
> -	if (bio_queue_enter(bio))
> +	/*
> +	 * We need to be able to enter a frozen queue, similar to how
> +	 * timeouts also need to do that. If that is blocked, then we can
> +	 * have pending IO when a queue freeze is started, and then the
> +	 * wait for the freeze to finish will wait for polled requests to
> +	 * timeout as the poller is preventer from entering the queue and
> +	 * completing them. As long as we prevent new IO from being queued,
> +	 * that should be all that matters.
> +	 */
> +	if (!percpu_ref_tryget(&q->q_usage_counter))
>  		return 0;
>  	if (queue_is_mq(q)) {
>  		ret = blk_mq_poll(q, cookie, iob, flags);


Looks good!

Reviewed-by: Keith Busch <kbusch@kernel.org>

      reply	other threads:[~2023-01-20 16:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 14:59 [PATCH] block: treat poll queue enter similarly to timeouts Jens Axboe
2023-01-20 16:11 ` 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=Y8q9OvUjPxSzif/j@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /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