From: Christoph Hellwig <hch@infradead.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Jens Axboe <axboe@kernel.dk>, Mike Snitzer <snitzer@redhat.com>,
linux-block@vger.kernel.org, dm-devel@redhat.com,
lining <lining2020x@163.com>, Tejun Heo <tj@kernel.org>,
Chunguang Xu <brookxu@tencent.com>
Subject: Re: [dm-devel] [PATCH 1/2] block: add resubmit_bio_noacct()
Date: Tue, 11 Jan 2022 00:42:25 -0800 [thread overview]
Message-ID: <Yd1C8Y6H7ZDhWY2k@infradead.org> (raw)
In-Reply-To: <Ydzj1JSoRGz+9g8B@T590>
On Tue, Jan 11, 2022 at 09:56:36AM +0800, Ming Lei wrote:
> 2) block throttle is block layer internal stuff, and we shouldn't expose
> blk_throtl_charge_bio_split() to driver.
>
> Maybe rename the new API as submit_split_bio_noacct(), but we can't
> reuse submit_bio_noacct() simply, otherwise blk_throtl_charge_bio_split()
> needs to be exported.
submit_bio_noacct should only ever be used for resubmitting bios that
came up from the upper layer, although they might not always be "split".
blk_throtl_charge_bio_split
> Another ides is to clearing BIO_THROTTLED before calling submit_bio_noacct(),
> meantime blk-throttle code needs to change to avoid double accounting of bio
> bytes, so the caller of submit_bio_noacct() still needs some change.
> This way can get smooth IOPS throttle, but needs to call __blk_throtl_bio
> for split bio one more time.
>
> Or other idea for this bio split vs. iops limit issue?
Well, if you want a helper specificly for splits, add one that actally
specifically handles splits and makes the callers life easier, something
like:
void bio_submit_splice(struct bio *split, struct bio *orig)
{
split->bi_opf |= REQ_NOMERGE;
trace_block_split(split, orig->bi_iter.bi_sector);
submit_bio_noacct(orig);
blk_throtl_charge_bio_split(orig);
}
including a proper kerneldoc comment.
But I still fail to grasp how a split is so different from just
resubmitting a not split bio.
next prev parent reply other threads:[~2022-01-11 8:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 7:51 [PATCH 0/2] block/dm: add resubmit_bio_noacct for fixing iops throttling Ming Lei
2022-01-10 7:51 ` [PATCH 1/2] block: add resubmit_bio_noacct() Ming Lei
2022-01-10 17:35 ` Christoph Hellwig
2022-01-10 19:03 ` Mike Snitzer
2022-01-11 2:26 ` Ming Lei
2022-01-11 8:36 ` [dm-devel] " Christoph Hellwig
2022-01-11 1:56 ` Ming Lei
2022-01-11 8:42 ` Christoph Hellwig [this message]
2022-01-10 7:51 ` [PATCH 2/2] dm: use resubmit_bio_noacct to submit split bio 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=Yd1C8Y6H7ZDhWY2k@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=brookxu@tencent.com \
--cc=dm-devel@redhat.com \
--cc=lining2020x@163.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=snitzer@redhat.com \
--cc=tj@kernel.org \
/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).