linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jeffle Xu <jefflexu@linux.alibaba.com>,
	axboe@kernel.dk, linux-block@vger.kernel.org,
	joseph.qi@linux.alibaba.com, hch@infradead.org
Subject: Re: [PATCH v6] block: disable iopoll for split bio
Date: Wed, 25 Nov 2020 07:48:43 +0000	[thread overview]
Message-ID: <20201125074843.GA12180@infradead.org> (raw)
In-Reply-To: <20201125071944.GA24725@T590>

On Wed, Nov 25, 2020 at 03:19:44PM +0800, Ming Lei wrote:
> 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).

  reply	other threads:[~2020-11-25  7:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  6:41 [PATCH v6] block: disable iopoll for split bio Jeffle Xu
2020-11-25  7:19 ` Ming Lei
2020-11-25  7:48   ` Christoph Hellwig [this message]
2020-11-25  8:05   ` JeffleXu
2020-11-25  8:19     ` Ming Lei
2020-11-25  9:15       ` JeffleXu
2020-11-25  8:29 ` Ming Lei
2020-11-25  9:17   ` JeffleXu
2020-11-25  9:52     ` Ming Lei

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=20201125074843.GA12180@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=jefflexu@linux.alibaba.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).