Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6910356rwb; Tue, 22 Nov 2022 22:23:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf744M7RJIyv6+XiIddUEpnZwqOQYhwRdcGxA0eSVZs996lwIl7Dao7sOI+gak7wQ13jix9E X-Received: by 2002:a17:90a:7003:b0:212:f169:140e with SMTP id f3-20020a17090a700300b00212f169140emr28392768pjk.215.1669184595284; Tue, 22 Nov 2022 22:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669184595; cv=none; d=google.com; s=arc-20160816; b=hMtkzxpZ04eQ2kpuAe/EbaOzgOCyPWFXSbVWPVz+crModNBz1n3aPOMKlHO8Zu1sVy yIHppaaJumfZfdmS6ZjwbJneBfbO7TW7fmgIRh+hCixRRYsCBBk6ztiOLDKDBV16CVIE UI8GNW7fLS3Zi+RhvGw5gEOg0gSMkUCrJMgdHEo7YALW7UgpKribCC87CGGoGRXL7OU8 Ti/FQTBvrFSL3M/phFqSNIpkgGh1DtHD4vrW/XQeQyK2ftI0YMQ2RObSfh6hjqGns5vM QNcaE+xDaxsjscAcumfggDYoilYC+OjcMWJvDwxX551kIMj/K/cr8KHGLbD03j087+K2 HUwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=EQHANdk/M9WEOYUTzwJxac4ccziLf7UXV4NLqo80jZY=; b=BUDEBmuLNXBhFOj6Dl9wajPk2Im79BpDn37yKL7UNdzW0A5Gpl9U40mi++d/qVwuoE T4QPC9YDKZhsdD61Q74yiyWcttzLrgvaPet/DUpf9TbbsKiHWVsNlhRiJyWbI2mpRoft 00EuQ8tK5EWJCyYYogWqK1UM8ZxkpxvOrp+Bhdd2V28GphfW/f1bdjWfIEV6w/W1pRUf 2rb8uq/tPVPvukRufJbSpUzNXBxMT84YJF6SLKzBBey/jyjp0I+mv2dh1fP9eqlp24jZ GInVnYG+8FhNvv1p1l1XKgSdfLNEdA/fqQ8x4W666RBECvReDBflTMTB0BgN1XexC+kM J8GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j19-20020a62b613000000b0055214e179d5si13702560pff.63.2022.11.22.22.23.02; Tue, 22 Nov 2022 22:23:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235606AbiKWGEf (ORCPT + 90 others); Wed, 23 Nov 2022 01:04:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235611AbiKWGEK (ORCPT ); Wed, 23 Nov 2022 01:04:10 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29833DB86F; Tue, 22 Nov 2022 22:04:07 -0800 (PST) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NH9Y15C6xzmW6g; Wed, 23 Nov 2022 14:03:33 +0800 (CST) Received: from huawei.com (10.174.178.129) by kwepemi500016.china.huawei.com (7.221.188.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 23 Nov 2022 14:04:04 +0800 From: Kemeng Shi To: , , CC: , , , Subject: [PATCH 01/11] blk-throttle: Limit whole system if root group is configured when on the default hierarchy Date: Wed, 23 Nov 2022 14:03:51 +0800 Message-ID: <20221123060401.20392-2-shikemeng@huawei.com> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20221123060401.20392-1-shikemeng@huawei.com> References: <20221123060401.20392-1-shikemeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.178.129] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500016.china.huawei.com (7.221.188.220) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoted from comment in throtl_pd_init: "If on the default hierarchy, we switch to properly hierarchical behavior where limits on a given throtl_grp are applied to the whole subtree rather than just the group itself. e.g. If 16M read_bps limit is set on the root group, the whole system can' exceed 16M for the device." Commit b22c417c885ea9 ("blk-throttle: configure bps/iops limit for cgroup in low limit") broke this rule and did not explain why. Restore the ability to limit the whole system by root group. Signed-off-by: Kemeng Shi --- block/blk-throttle.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 847721dc2b2b..96aa53e30e28 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -150,9 +150,6 @@ static uint64_t tg_bps_limit(struct throtl_grp *tg, int rw) struct throtl_data *td; uint64_t ret; - if (cgroup_subsys_on_dfl(io_cgrp_subsys) && !blkg->parent) - return U64_MAX; - td = tg->td; ret = tg->bps[rw][td->limit_index]; if (ret == 0 && td->limit_index == LIMIT_LOW) { @@ -180,9 +177,6 @@ static unsigned int tg_iops_limit(struct throtl_grp *tg, int rw) struct throtl_data *td; unsigned int ret; - if (cgroup_subsys_on_dfl(io_cgrp_subsys) && !blkg->parent) - return UINT_MAX; - td = tg->td; ret = tg->iops[rw][td->limit_index]; if (ret == 0 && tg->td->limit_index == LIMIT_LOW) { -- 2.30.0