diff options
author | Tejun Heo <tj@kernel.org> | 2013-08-08 20:11:25 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-08-08 20:11:25 -0400 |
commit | 492eb21b98f88e411a8bb43d6edcd7d7022add10 (patch) | |
tree | da06df9485fd607762fdec06169f7d9f601e3cf6 /block/blk-throttle.c | |
parent | f48e3924dca268c677c4e338e5d91ad9e6fe6b9e (diff) |
cgroup: make hierarchy iterators deal with cgroup_subsys_state instead of cgroup
cgroup is currently in the process of transitioning to using css
(cgroup_subsys_state) as the primary handle instead of cgroup in
subsystem API. For hierarchy iterators, this is beneficial because
* In most cases, css is the only thing subsystems care about anyway.
* On the planned unified hierarchy, iterations for different
subsystems will need to skip over different subtrees of the
hierarchy depending on which subsystems are enabled on each cgroup.
Passing around css makes it unnecessary to explicitly specify the
subsystem in question as css is intersection between cgroup and
subsystem
* For the planned unified hierarchy, css's would need to be created
and destroyed dynamically independent from cgroup hierarchy. Having
cgroup core manage css iteration makes enforcing deref rules a lot
easier.
Most subsystem conversions are straight-forward. Noteworthy changes
are
* blkio: cgroup_to_blkcg() is no longer used. Removed.
* freezer: cgroup_freezer() is no longer used. Removed.
* devices: cgroup_to_devcgroup() is no longer used. Removed.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Aristeu Rozanski <aris@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Matt Helsley <matthltc@us.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r-- | block/blk-throttle.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 88bcfb651b0b..8cefa7f8590e 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -1349,7 +1349,7 @@ static int tg_set_conf(struct cgroup_subsys_state *css, struct cftype *cft, | |||
1349 | struct throtl_grp *tg; | 1349 | struct throtl_grp *tg; |
1350 | struct throtl_service_queue *sq; | 1350 | struct throtl_service_queue *sq; |
1351 | struct blkcg_gq *blkg; | 1351 | struct blkcg_gq *blkg; |
1352 | struct cgroup *pos_cgrp; | 1352 | struct cgroup_subsys_state *pos_css; |
1353 | int ret; | 1353 | int ret; |
1354 | 1354 | ||
1355 | ret = blkg_conf_prep(blkcg, &blkcg_policy_throtl, buf, &ctx); | 1355 | ret = blkg_conf_prep(blkcg, &blkcg_policy_throtl, buf, &ctx); |
@@ -1380,7 +1380,7 @@ static int tg_set_conf(struct cgroup_subsys_state *css, struct cftype *cft, | |||
1380 | * blk-throttle. | 1380 | * blk-throttle. |
1381 | */ | 1381 | */ |
1382 | tg_update_has_rules(tg); | 1382 | tg_update_has_rules(tg); |
1383 | blkg_for_each_descendant_pre(blkg, pos_cgrp, ctx.blkg) | 1383 | blkg_for_each_descendant_pre(blkg, pos_css, ctx.blkg) |
1384 | tg_update_has_rules(blkg_to_tg(blkg)); | 1384 | tg_update_has_rules(blkg_to_tg(blkg)); |
1385 | 1385 | ||
1386 | /* | 1386 | /* |
@@ -1623,7 +1623,7 @@ void blk_throtl_drain(struct request_queue *q) | |||
1623 | { | 1623 | { |
1624 | struct throtl_data *td = q->td; | 1624 | struct throtl_data *td = q->td; |
1625 | struct blkcg_gq *blkg; | 1625 | struct blkcg_gq *blkg; |
1626 | struct cgroup *pos_cgrp; | 1626 | struct cgroup_subsys_state *pos_css; |
1627 | struct bio *bio; | 1627 | struct bio *bio; |
1628 | int rw; | 1628 | int rw; |
1629 | 1629 | ||
@@ -1636,7 +1636,7 @@ void blk_throtl_drain(struct request_queue *q) | |||
1636 | * better to walk service_queue tree directly but blkg walk is | 1636 | * better to walk service_queue tree directly but blkg walk is |
1637 | * easier. | 1637 | * easier. |
1638 | */ | 1638 | */ |
1639 | blkg_for_each_descendant_post(blkg, pos_cgrp, td->queue->root_blkg) | 1639 | blkg_for_each_descendant_post(blkg, pos_css, td->queue->root_blkg) |
1640 | tg_drain_bios(&blkg_to_tg(blkg)->service_queue); | 1640 | tg_drain_bios(&blkg_to_tg(blkg)->service_queue); |
1641 | 1641 | ||
1642 | tg_drain_bios(&td_root_tg(td)->service_queue); | 1642 | tg_drain_bios(&td_root_tg(td)->service_queue); |