Internal nodes that issued IOs are treated as root when leaves are activated. However, leaf nodes can still be activated when internal nodes are active, leaving the sum of hweights exceeds HWEIGHT_WHOLE. I think we should also treat the leaf nodes as root while leaf-only constraint broken. Signed-off-by: Jiufei Xue <jiufei.xue@xxxxxxxxxxxxxxxxx> --- block/blk-iocost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index a7ed434..d3ca6e8 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1057,8 +1057,8 @@ static bool iocg_activate(struct ioc_gq *iocg, struct ioc_now *now) atomic64_set(&iocg->active_period, cur_period); /* already activated or breaking leaf-only constraint? */ - for (i = iocg->level; i > 0; i--) - if (!list_empty(&iocg->active_list)) + for (i = iocg->level - 1; i > 0; i--) + if (!list_empty(&iocg->ancestors[i]->active_list)) goto fail_unlock; if (iocg->child_active_sum) goto fail_unlock; -- 1.8.3.1