diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-05 16:15:05 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-06 15:27:22 -0500 |
commit | f51b802c17e2a21926b29911493f5e7ddf6eee87 (patch) | |
tree | c32d9ea2a61201b0c6bf59b349300af04dbc3686 /block/blk-core.c | |
parent | 035d10b2fa7e5f7e9bf9465dbc39c35affd5ac32 (diff) |
blkcg: use the usual get blkg path for root blkio_group
For root blkg, blk_throtl_init() was using throtl_alloc_tg()
explicitly and cfq_init_queue() was manually initializing embedded
cfqd->root_group, adding unnecessarily different code paths to blkg
handling.
Make both use the usual blkio_group get functions - throtl_get_tg()
and cfq_get_cfqg() - for the root blkio_group too. Note that
blk_throtl_init() callsite is pushed downwards in
blk_alloc_queue_node() so that @q is sufficiently initialized for
throtl_get_tg().
This simplifies root blkg handling noticeably for cfq and will allow
further modularization of blkcg API.
-v2: Vivek pointed out that using cfq_get_cfqg() won't work if
CONFIG_CFQ_GROUP_IOSCHED is disabled. Fix it by factoring out
initialization of base part of cfqg into cfq_init_cfqg_base() and
alloc/init/free explicitly if !CONFIG_CFQ_GROUP_IOSCHED.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 7713c73d9590..5a1b8cc03003 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -540,9 +540,6 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) | |||
540 | if (err) | 540 | if (err) |
541 | goto fail_id; | 541 | goto fail_id; |
542 | 542 | ||
543 | if (blk_throtl_init(q)) | ||
544 | goto fail_id; | ||
545 | |||
546 | setup_timer(&q->backing_dev_info.laptop_mode_wb_timer, | 543 | setup_timer(&q->backing_dev_info.laptop_mode_wb_timer, |
547 | laptop_mode_timer_fn, (unsigned long) q); | 544 | laptop_mode_timer_fn, (unsigned long) q); |
548 | setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q); | 545 | setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q); |
@@ -565,6 +562,9 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) | |||
565 | */ | 562 | */ |
566 | q->queue_lock = &q->__queue_lock; | 563 | q->queue_lock = &q->__queue_lock; |
567 | 564 | ||
565 | if (blk_throtl_init(q)) | ||
566 | goto fail_id; | ||
567 | |||
568 | return q; | 568 | return q; |
569 | 569 | ||
570 | fail_id: | 570 | fail_id: |