diff options
author | Dennis Zhou <dennis@kernel.org> | 2018-12-05 12:10:29 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-12-07 22:26:36 -0700 |
commit | 2268c0feb0ffb1c1bb6e1d4d5505d30f485aa77b (patch) | |
tree | e53dac6e15fa377325f7af425f4c8ecf997198e5 /block/blk-iolatency.c | |
parent | beea9da07d8a6228a7e4a31a83f9478d513bf03f (diff) | |
download | linux-2268c0feb0ffb1c1bb6e1d4d5505d30f485aa77b.tar.gz linux-2268c0feb0ffb1c1bb6e1d4d5505d30f485aa77b.tar.bz2 linux-2268c0feb0ffb1c1bb6e1d4d5505d30f485aa77b.zip |
blkcg: introduce common blkg association logic
There are 3 ways blkg association can happen: association with the
current css, with the page css (swap), or from the wbc css (writeback).
This patch handles how association is done for the first case where we
are associating bsaed on the current css. If there is already a blkg
associated, the css will be reused and association will be redone as the
request_queue may have changed.
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-iolatency.c')
-rw-r--r-- | block/blk-iolatency.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 46e86c34cf79..cdbd10564e66 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -472,21 +472,15 @@ static void check_scale_change(struct iolatency_grp *iolat) static void blkcg_iolatency_throttle(struct rq_qos *rqos, struct bio *bio) { struct blk_iolatency *blkiolat = BLKIOLATENCY(rqos); - struct blkcg *blkcg; struct blkcg_gq *blkg; - struct request_queue *q = rqos->q; bool issue_as_root = bio_issue_as_root_blkg(bio); if (!blk_iolatency_enabled(blkiolat)) return; - rcu_read_lock(); - bio_associate_blkcg(bio, NULL); - blkcg = bio_blkcg(bio); - blkg = blkg_lookup_create(blkcg, q); + bio_associate_blkg(bio); + blkg = bio->bi_blkg; bio_issue_init(&bio->bi_issue, bio_sectors(bio)); - bio_associate_blkg(bio, blkg); - rcu_read_unlock(); while (blkg && blkg->parent) { struct iolatency_grp *iolat = blkg_to_lat(blkg); |