Re: [PATCH V2] block: avoid io timeout in case of sync polled dio

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

 



On Fri, Apr 15, 2022 at 11:47:03AM +0800, Ming Lei wrote:
> +	/* make sure the bio is issued before polling */
> +	if (bio.bi_opf & REQ_POLLED)
> +		blk_flush_plug(current->plug, false);

I still think the core code should handle this.  Without that we'd need
to export the blk_flush_plug for anything that would want to poll bios
from modules, in addition to it generally being a mess.  See a proposed
patch for that below.  I'd also split the flush aspect from the poll
aspect into two patches.

> +		if (bio.bi_opf & REQ_POLLED)
> +			bio_poll(&bio, NULL, 0);
> +		else
>  			blk_io_schedule();

Instead of this duplicate logic everywhere I'd just make bio_boll
call blk_io_schedule for the !REQ_POLLED case and simplify all the
callers.

> +			if (dio->submit.poll_bio &&
> +					(dio->submit.poll_bio->bi_opf &
> +						REQ_POLLED))

This indentation looks awfull,normal would be:

			if (dio->submit.poll_bio &&
			    (dio->submit.poll_bio->bi_opf & REQ_POLLED))

---

[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