diff options
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r-- | block/blk-throttle.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 381b09bb562b..a89043a3caa4 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -168,7 +168,15 @@ static struct throtl_grp * throtl_find_alloc_tg(struct throtl_data *td, | |||
168 | * tree of blkg (instead of traversing through hash list all | 168 | * tree of blkg (instead of traversing through hash list all |
169 | * the time. | 169 | * the time. |
170 | */ | 170 | */ |
171 | tg = tg_of_blkg(blkiocg_lookup_group(blkcg, key)); | 171 | |
172 | /* | ||
173 | * This is the common case when there are no blkio cgroups. | ||
174 | * Avoid lookup in this case | ||
175 | */ | ||
176 | if (blkcg == &blkio_root_cgroup) | ||
177 | tg = &td->root_tg; | ||
178 | else | ||
179 | tg = tg_of_blkg(blkiocg_lookup_group(blkcg, key)); | ||
172 | 180 | ||
173 | /* Fill in device details for root group */ | 181 | /* Fill in device details for root group */ |
174 | if (tg && !tg->blkg.dev && bdi->dev && dev_name(bdi->dev)) { | 182 | if (tg && !tg->blkg.dev && bdi->dev && dev_name(bdi->dev)) { |