aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.c13
-rw-r--r--block/blk-throttle.c6
2 files changed, 14 insertions, 5 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 28d227c5ca77..e17da947f6bd 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -928,7 +928,15 @@ struct cgroup_subsys blkio_cgrp_subsys = {
928 .css_offline = blkcg_css_offline, 928 .css_offline = blkcg_css_offline,
929 .css_free = blkcg_css_free, 929 .css_free = blkcg_css_free,
930 .can_attach = blkcg_can_attach, 930 .can_attach = blkcg_can_attach,
931 .base_cftypes = blkcg_files, 931 .legacy_cftypes = blkcg_files,
932#ifdef CONFIG_MEMCG
933 /*
934 * This ensures that, if available, memcg is automatically enabled
935 * together on the default hierarchy so that the owner cgroup can
936 * be retrieved from writeback pages.
937 */
938 .depends_on = 1 << memory_cgrp_id,
939#endif
932}; 940};
933EXPORT_SYMBOL_GPL(blkio_cgrp_subsys); 941EXPORT_SYMBOL_GPL(blkio_cgrp_subsys);
934 942
@@ -1120,7 +1128,8 @@ int blkcg_policy_register(struct blkcg_policy *pol)
1120 1128
1121 /* everything is in place, add intf files for the new policy */ 1129 /* everything is in place, add intf files for the new policy */
1122 if (pol->cftypes) 1130 if (pol->cftypes)
1123 WARN_ON(cgroup_add_cftypes(&blkio_cgrp_subsys, pol->cftypes)); 1131 WARN_ON(cgroup_add_legacy_cftypes(&blkio_cgrp_subsys,
1132 pol->cftypes));
1124 ret = 0; 1133 ret = 0;
1125out_unlock: 1134out_unlock:
1126 mutex_unlock(&blkcg_pol_mutex); 1135 mutex_unlock(&blkcg_pol_mutex);
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 3fdb21a390c1..9273d0969ebd 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -412,13 +412,13 @@ static void throtl_pd_init(struct blkcg_gq *blkg)
412 int rw; 412 int rw;
413 413
414 /* 414 /*
415 * If sane_hierarchy is enabled, we switch to properly hierarchical 415 * If on the default hierarchy, we switch to properly hierarchical
416 * behavior where limits on a given throtl_grp are applied to the 416 * behavior where limits on a given throtl_grp are applied to the
417 * whole subtree rather than just the group itself. e.g. If 16M 417 * whole subtree rather than just the group itself. e.g. If 16M
418 * read_bps limit is set on the root group, the whole system can't 418 * read_bps limit is set on the root group, the whole system can't
419 * exceed 16M for the device. 419 * exceed 16M for the device.
420 * 420 *
421 * If sane_hierarchy is not enabled, the broken flat hierarchy 421 * If not on the default hierarchy, the broken flat hierarchy
422 * behavior is retained where all throtl_grps are treated as if 422 * behavior is retained where all throtl_grps are treated as if
423 * they're all separate root groups right below throtl_data. 423 * they're all separate root groups right below throtl_data.
424 * Limits of a group don't interact with limits of other groups 424 * Limits of a group don't interact with limits of other groups
@@ -426,7 +426,7 @@ static void throtl_pd_init(struct blkcg_gq *blkg)
426 */ 426 */
427 parent_sq = &td->service_queue; 427 parent_sq = &td->service_queue;
428 428
429 if (cgroup_sane_behavior(blkg->blkcg->css.cgroup) && blkg->parent) 429 if (cgroup_on_dfl(blkg->blkcg->css.cgroup) && blkg->parent)
430 parent_sq = &blkg_to_tg(blkg->parent)->service_queue; 430 parent_sq = &blkg_to_tg(blkg->parent)->service_queue;
431 431
432 throtl_service_queue_init(&tg->service_queue, parent_sq); 432 throtl_service_queue_init(&tg->service_queue, parent_sq);