Message ID | f998a0a4d1117f7438dea22c565aeb799d112d31.1496432591.git.shli@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Jun 02, 2017 at 02:54:01PM -0700, Shaohua Li wrote: > @@ -691,6 +691,8 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, > rcu_read_lock(); > blkcg = bio_blkcg(bio); > > + bio_associate_blkcg(bio, &blkcg->css); > + Let's please note that this only established the fallback mapping when the bio hasn't been associated yet and doesn't override the existing association. Thanks.
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index b78db2e..53d3e3d 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -2033,14 +2033,9 @@ static inline void throtl_update_latency_buckets(struct throtl_data *td) static void blk_throtl_assoc_bio(struct throtl_grp *tg, struct bio *bio) { #ifdef CONFIG_BLK_DEV_THROTTLING_LOW - int ret; - - ret = bio_associate_current(bio); - if (ret == 0 || ret == -EBUSY) + if (bio->bi_css) bio->bi_cg_private = tg; blk_stat_set_issue(&bio->bi_issue_stat, bio_sectors(bio)); -#else - bio_associate_current(bio); #endif } diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index 01b62e7..d176247 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h @@ -691,6 +691,8 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, rcu_read_lock(); blkcg = bio_blkcg(bio); + bio_associate_blkcg(bio, &blkcg->css); + blkg = blkg_lookup(blkcg, q); if (unlikely(!blkg)) { spin_lock_irq(q->queue_lock);