summaryrefslogtreecommitdiffstats
path: root/include/linux/blk-cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-08-18 14:55:18 -0700
committerJens Axboe <axboe@fb.com>2015-08-18 15:49:17 -0700
commit85b6bc9db6d5ab6980b43c38b5cbd11d24414ce4 (patch)
tree7389d8656738b72cc7c8c7569247db31800d9246 /include/linux/blk-cgroup.h
parent24f290466f79a6497f1654f64b9a841872cba3ca (diff)
downloadblackbird-op-linux-85b6bc9db6d5ab6980b43c38b5cbd11d24414ce4.tar.gz
blackbird-op-linux-85b6bc9db6d5ab6980b43c38b5cbd11d24414ce4.zip
blkcg: move root blkg lookup optimization from throtl_lookup_tg() to __blkg_lookup()
Currently, both throttle and cfq policies implement their own root blkg (blkcg_gq) lookup fast path. This patch moves root blkg optimization from throtl_lookup_tg() to __blkg_lookup(). cfq-iosched currently doesn't use blkg_lookup() but will be converted and drop the optimization too. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Arianna Avanzini <avanzini.arianna@gmail.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/blk-cgroup.h')
-rw-r--r--include/linux/blk-cgroup.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index d5b54aa50582..0609bce69f68 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -249,6 +249,9 @@ static inline struct blkcg_gq *__blkg_lookup(struct blkcg *blkcg,
{
struct blkcg_gq *blkg;
+ if (blkcg == &blkcg_root)
+ return q->root_blkg;
+
blkg = rcu_dereference(blkcg->blkg_hint);
if (blkg && blkg->q == q)
return blkg;
OpenPOWER on IntegriCloud