Re: [PATCH v6] block: disable iopoll for split bio
From: Christoph Hellwig <hch@infradead.org>
Date: 2020-11-25 07:48:52
On Wed, Nov 25, 2020 at 03:19:44PM +0800, Ming Lei wrote:
quoted hunk ↗ jump to hunk
Not sure the new bio flag is really required for this case, just wondering why not take the following simple way? BTW we are really going to run out of bio flag.diff --git a/block/blk-mq.c b/block/blk-mq.c index 55bcee5dc032..1139b1efd712 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c@@ -2157,6 +2157,7 @@ blk_qc_t blk_mq_submit_bio(struct bio *bio) unsigned int nr_segs; blk_qc_t cookie; blk_status_t ret; + struct bio *orig_bio = bio; blk_queue_bounce(q, &bio); __blk_queue_split(&bio, &nr_segs);@@ -2265,6 +2266,10 @@ blk_qc_t blk_mq_submit_bio(struct bio *bio) blk_mq_sched_insert_request(rq, false, true, true); } + /* don't poll splitted bio */ + if (orig_bio != bio) + return BLK_QC_T_NONE; + return cookie; queue_exit: blk_queue_exit(q);
Yeah, this looks simpler and more obvious, and it also catches the bounce buffering case (not that polling + bounce buffering should ever happen).