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)) ---