* [PATCH] block: don't do cgroup accounting for split bio's
@ 2018-07-27 21:14 Josef Bacik
2018-07-27 21:17 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Josef Bacik @ 2018-07-27 21:14 UTC (permalink / raw)
To: linux-block, kernel-team
We need to check in blkcg_bio_issue_check if the bio is flagged as
QUEUE_ENTERED, because if it is then we've already accounted for the IO
in the cgroup stats.
Reported-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
include/linux/blk-cgroup.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index 3bed5e02a873..a977c31688ae 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -767,7 +767,8 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q,
throtl = blk_throtl_bio(q, blkg, bio);
- if (!throtl) {
+ if (!throtl &&
+ !bio_flagged(bio, BIO_QUEUE_ENTERED)) {
blkg = blkg ?: q->root_blkg;
blkg_rwstat_add(&blkg->stat_bytes, bio->bi_opf,
bio->bi_iter.bi_size);
--
2.14.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] block: don't do cgroup accounting for split bio's
2018-07-27 21:14 [PATCH] block: don't do cgroup accounting for split bio's Josef Bacik
@ 2018-07-27 21:17 ` Jens Axboe
2018-07-27 21:19 ` Josef Bacik
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2018-07-27 21:17 UTC (permalink / raw)
To: Josef Bacik, linux-block, kernel-team
On 7/27/18 3:14 PM, Josef Bacik wrote:
> We need to check in blkcg_bio_issue_check if the bio is flagged as
> QUEUE_ENTERED, because if it is then we've already accounted for the IO
> in the cgroup stats.
That's a bit of a flag overload, I think that at least warrants a
comment.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block: don't do cgroup accounting for split bio's
2018-07-27 21:17 ` Jens Axboe
@ 2018-07-27 21:19 ` Josef Bacik
0 siblings, 0 replies; 3+ messages in thread
From: Josef Bacik @ 2018-07-27 21:19 UTC (permalink / raw)
To: Jens Axboe; +Cc: Josef Bacik, linux-block, kernel-team
On Fri, Jul 27, 2018 at 03:17:11PM -0600, Jens Axboe wrote:
> On 7/27/18 3:14 PM, Josef Bacik wrote:
> > We need to check in blkcg_bio_issue_check if the bio is flagged as
> > QUEUE_ENTERED, because if it is then we've already accounted for the IO
> > in the cgroup stats.
>
> That's a bit of a flag overload, I think that at least warrants a
> comment.
Yeah I'm not a fan of it, but there's nothing else to indicate that the bio is a
split bio other than checking if it's endio is the chain endio. I'll respin
with the comment. Thanks,
Josef
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-27 22:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-27 21:14 [PATCH] block: don't do cgroup accounting for split bio's Josef Bacik
2018-07-27 21:17 ` Jens Axboe
2018-07-27 21:19 ` Josef Bacik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox