diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-05 22:15:11 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-06 21:27:23 +0100 |
commit | 7ee9c5620504906e98451dc9a1945b2b9e892cb8 (patch) | |
tree | 1daf4d9fc8d03ebbc88ceedb7abeec46d8c71df3 /block/blk-throttle.c | |
parent | blkcg: skip blkg printing if q isn't associated with disk (diff) | |
download | linux-7ee9c5620504906e98451dc9a1945b2b9e892cb8.tar.xz linux-7ee9c5620504906e98451dc9a1945b2b9e892cb8.zip |
blkcg: let blkio_group point to blkio_cgroup directly
Currently, blkg points to the associated blkcg via its css_id. This
unnecessarily complicates dereferencing blkcg. Let blkg hold a
reference to the associated blkcg and point directly to it and disable
css_id on blkio_subsys.
This change requires splitting blkiocg_destroy() into
blkiocg_pre_destroy() and blkiocg_destroy() so that all blkg's can be
destroyed and all the blkcg references held by them dropped during
cgroup removal.
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-throttle.c')
-rw-r--r-- | block/blk-throttle.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 52a429397d3b..fe6a442b8482 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -169,6 +169,9 @@ static void throtl_put_tg(struct throtl_grp *tg) if (!atomic_dec_and_test(&tg->ref)) return; + /* release the extra blkcg reference this blkg has been holding */ + css_put(&tg->blkg.blkcg->css); + /* * A group is freed in rcu manner. But having an rcu lock does not * mean that one can access all the fields of blkg and assume these |