Skip to contentSkip to conversation

block: don't do cgroup accounting for split bio's

PATCH In review Josef Bacik 2 participants 3 messages Jul 27, 2018

Subsystems (2)
lore
Share & tools
lore

Josef Bacik

author maintainer
#0 lore raw

PATCH 1/1 block: don't do cgroup accounting for split bio's

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.

---
 include/linux/blk-cgroup.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/blk-cgroup.h +2 -1
index 3bed5e02a873..a977c31688ae 100644
@@ -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);
Signature · 1 line
2.14.3
maintainer
#1 lore raw
Quoted 3 lines · Josef Bacik

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.

Signature · 1 line
Jens Axboe
author maintainer
#2 lore raw
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Josef Bacik

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