From 868591a0afb449c39ae85bb8a74deb64ea7c8456 Mon Sep 17 00:00:00 2001 From: Joseph Qi Date: Tue, 12 Dec 2017 19:05:51 +0800 Subject: [PATCH] block-throttle: enable hierarchical throttling even on traditional hierarchy ECI may have an use case that configuring each device mapper disk throttling policy just under root blkio cgroup, but actually using them in different containers. Since hierarchical throttling is now only supported on cgroup v2 and ECI uses cgroup v1, so we have to enable hierarchical throttling on cgroup v1. This is ported from redhat 7u, and a year ago Jiufei already ported it to alikernel 4.9 as well. So I think this change should be acceptable. Signed-off-by: Joseph Qi Reviewed-by: Jiufei Xue --- block/blk-throttle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index caee658609d7..506a59f1000f 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -535,7 +535,9 @@ static void throtl_pd_init(struct blkg_policy_data *pd) * regardless of the position of the group in the hierarchy. */ sq->parent_sq = &td->service_queue; - if (cgroup_subsys_on_dfl(io_cgrp_subsys) && blkg->parent) + + /* Enable hierarchical throttling even on traditional hierarchy */ + if (blkg->parent) sq->parent_sq = &blkg_to_tg(blkg->parent)->service_queue; tg->td = td; } -- GitLab