diff options
author | Tejun Heo <tj@kernel.org> | 2015-10-22 09:27:12 +0900 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-06-24 21:31:54 +0800 |
commit | 44069b0826b6f76a8601ad880b10557c7e4968c9 (patch) | |
tree | 8eb1649e7afa17c875c662d9de17ac139c63344b | |
parent | 8a5f8dc0279656aa672ac4e7092c3250820220b6 (diff) |
blkcg: fix incorrect read/write sync/async stat accounting
While unifying how blkcg stats are collected, 77ea733884eb ("blkcg:
move io_service_bytes and io_serviced stats into blkcg_gq")
incorrectly used bio->flags instead of bio->rw to tell the IO type.
This made IOs to be accounted as the wrong type. Fix it.
Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 77ea733884eb ("blkcg: move io_service_bytes and io_serviced stats into blkcg_gq")
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 174fd8d369613c4e06660f3704caaba48dac8554)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r-- | include/linux/blk-cgroup.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index 0a5cc7a1109b..c02e669945e9 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h @@ -713,9 +713,9 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, if (!throtl) { blkg = blkg ?: q->root_blkg; - blkg_rwstat_add(&blkg->stat_bytes, bio->bi_flags, + blkg_rwstat_add(&blkg->stat_bytes, bio->bi_rw, bio->bi_iter.bi_size); - blkg_rwstat_add(&blkg->stat_ios, bio->bi_flags, 1); + blkg_rwstat_add(&blkg->stat_ios, bio->bi_rw, 1); } rcu_read_unlock(); |