Re: [PATCH] block: treat poll queue enter similarly to timeouts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux