diff options
author | Shaohua Li <shli@fb.com> | 2017-07-12 14:49:54 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-07-29 11:00:03 -0400 |
commit | 007cc56b7eeca8848021bc43aca2b8607fbe5589 (patch) | |
tree | d178bdf4a51e3a0b6b4b72341dd10b9aa3d299c4 /block/blk-throttle.c | |
parent | ca1136c99b66b1566781ff12ecddc635d570f932 (diff) |
block: always attach cgroup info into bio
blkcg_bio_issue_check() already gets blkcg for a BIO.
bio_associate_blkcg() uses a percpu refcounter, so it's a very cheap
operation. There is no point we don't attach the cgroup info into bio at
blkcg_bio_issue_check. This also makes blktrace outputs correct cgroup
info.
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r-- | block/blk-throttle.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index a7285bf2831c..a6ebd2bdb4df 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -2104,14 +2104,9 @@ static inline void throtl_update_latency_buckets(struct throtl_data *td) | |||
2104 | static void blk_throtl_assoc_bio(struct throtl_grp *tg, struct bio *bio) | 2104 | static void blk_throtl_assoc_bio(struct throtl_grp *tg, struct bio *bio) |
2105 | { | 2105 | { |
2106 | #ifdef CONFIG_BLK_DEV_THROTTLING_LOW | 2106 | #ifdef CONFIG_BLK_DEV_THROTTLING_LOW |
2107 | int ret; | 2107 | if (bio->bi_css) |
2108 | |||
2109 | ret = bio_associate_current(bio); | ||
2110 | if (ret == 0 || ret == -EBUSY) | ||
2111 | bio->bi_cg_private = tg; | 2108 | bio->bi_cg_private = tg; |
2112 | blk_stat_set_issue(&bio->bi_issue_stat, bio_sectors(bio)); | 2109 | blk_stat_set_issue(&bio->bi_issue_stat, bio_sectors(bio)); |
2113 | #else | ||
2114 | bio_associate_current(bio); | ||
2115 | #endif | 2110 | #endif |
2116 | } | 2111 | } |
2117 | 2112 | ||