From nobody Fri Sep 25 14:32:11 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1296473C64; Fri, 11 Sep 2026 09:23:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789118638; cv=none; b=moqVTnBDMTXAt/mtEUCjgGZkIUq0ja5bfGNHgeptK9ZEp0yVOaTc62GhYfExZoat/ThY47Z05DL3ucL/el5XZH2a0YOVKXMJ0PDdnz2p8tUpPePY9JRJT00R8cabM6Y1KL0HqcSitayivhzjmpdvw50PjJmio5FkO3UW3cW4oII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789118638; c=relaxed/simple; bh=TwOg2W1Rba3GiaVyt5+z3Hcq3VKX9TYFrET+K6HGuW0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=LHDfbn9hC6WkcI3yCmwCLfhnlCmjCsDnwqzcyHjHm9d76XJM/ii4tBZkP39lpuH5PaShNlLMurSDowXEk9t0fHjLX+CW73C74Yq4lXdgG0iLIc11T8oKCQjqbdDOyaqPfJIwsKWqUDyDLQO/bAOOOj8agkT+mPcMX/3DTVKi+zg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 7db3d4faadc211f19a56ed5b684f684d-20260911 X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME, HR_CTE_8B HR_CTT_TXT, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_DIGIT_LEN HR_FROM_NAME, HR_SJ_DIGIT_LEN, HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER HR_SJ_NOR_SYM, HR_SJ_PHRASE, HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT HR_TO_DOMAIN_COUNT, HR_TO_NO_NAME, IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED SA_EXISTED, SN_EXISTED, SPF_NOPASS, DKIM_NOPASS, DMARC_NOPASS CIE_BAD, CIE_GOOD, CIE_GOOD_SPF, GTI_FG_BS, GTI_RG_INFO GTI_C_BU, AMN_GOOD, ABX_MISS_RDNS X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.19,REQID:57a0b188-c647-48a8-b677-052f93c75c27,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:10 X-CID-INFO: VERSION:1.3.19,REQID:57a0b188-c647-48a8-b677-052f93c75c27,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:10 X-CID-META: VersionHash:7db8b62,CLOUDID:76b9662aae906c85325425ccc1c35306,BulkI D:260911163847ZVY704ZU,BulkQuantity:14,SF:17|19|38|66|78|81|82|102|127|136 |850|865|898,TC:nil,Content:0|15|50|99,EDM:-3|-100,IP:-2,URL:0,File:nil,RT :nil,Bulk:40,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP: 0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_OBB,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 7db3d4faadc211f19a56ed5b684f684d-20260911 X-User: liuzhe1@kylinos.cn Received: from localhost.localdomain [(223.70.159.239)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 2090279726; Fri, 11 Sep 2026 17:23:46 +0800 From: Zhe Liu To: tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, corbet@lwn.net, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org Cc: skhan@linuxfoundation.org, rdunlap@infradead.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, dtcccc@linux.alibaba.com, changhuaixin@linux.alibaba.com, shanpeic@linux.alibaba.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Zhe Liu , Tao Cui Subject: [PATCH v3 1/3] sched/fair: remove quota/burst write-order dependency Date: Fri, 11 Sep 2026 17:22:56 +0800 Message-Id: <20260911092258.660771-2-liuzhe1@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260911092258.660771-1-liuzhe1@kylinos.cn> References: <20260911092258.660771-1-liuzhe1@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Burst validation currently depends on the active quota, so the same quota and burst values may be accepted or rejected depending on the order in which userspace updates them. Make burst validation independent of the current quota while preserving, for finite quotas, the previous maximum configurable burst at max_bw_runtime_us / 2. Keep the configured burst across quota updates and cap the effective burst to min(burst, quota) when CFS runtime is refilled. Fixes: f4183717b370 ("sched/fair: Introduce the burstable CFS controller") Signed-off-by: Zhe Liu Tested-by: Tao Cui Reviewed-by: Michal Koutn=C3=BD Reviewed-by: Ben Segall --- kernel/sched/core.c | 3 +-- kernel/sched/fair.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b998ef6b87af..c399f0a59c25 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -10181,8 +10181,7 @@ static int tg_set_bandwidth(struct task_group *tg, if (quota_us !=3D RUNTIME_INF && quota_us > max_bw_runtime_us) return -EINVAL; =20 - if (quota_us !=3D RUNTIME_INF && (burst_us > quota_us || - burst_us + quota_us > max_bw_runtime_us)) + if (burst_us > max_bw_runtime_us / 2) return -EINVAL; =20 #ifdef CONFIG_CFS_BANDWIDTH diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ade1eceb39b8..e6f9d9296fd2 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6627,7 +6627,8 @@ void __refill_cfs_bandwidth_runtime(struct cfs_bandwi= dth *cfs_b) cfs_b->nr_burst++; } =20 - cfs_b->runtime =3D min(cfs_b->runtime, cfs_b->quota + cfs_b->burst); + cfs_b->runtime =3D min(cfs_b->runtime, + cfs_b->quota + min(cfs_b->burst, cfs_b->quota)); cfs_b->runtime_snap =3D cfs_b->runtime; } =20 --=20 2.25.1 From nobody Fri Sep 25 14:32:11 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C2C14734CF; Fri, 11 Sep 2026 09:23:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789118644; cv=none; b=RAZR0Fals5MJrZUXvMkn5HY0WyoJN8Xbj8yXDvK5Z9iL/5xOLcspSvAjrXFc6MeRkGFoImrJ1SyBZMH53diihtQPZWeozaXhG9w1tSiibd4dkKrrUJZp+lpb/AhiwMEOa9eAB7yDOoJ9TMkMuTenEHYmqUaa+ufY7hH+eu401zI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789118644; c=relaxed/simple; bh=ArINyC6ySGVQqQoDMGjIUkoOPSRdrrb2PVVpVoMzUYM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=l6tu7Ad2dBZ1k4kw7iDt26fg3m4fLG8g4tVgbvghEFE6XjCEJSbvDxnrQWHuHr6MSeXXDxCG5vVWi4eaRUvnTaOuaLdsoTXzFpLS9aEuF+VZi0ImwjEU7/CKE0Mr1iGF6KNw0yheQ/yjSDTSSEiMSDkbIgYAH2kSGyGWdWHXmkQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 7fc14c32adc211f19a56ed5b684f684d-20260911 X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME, HR_CTE_8B HR_CTT_MISS, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_DIGIT_LEN HR_FROM_NAME, HR_SJ_DIGIT_LEN, HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER HR_SJ_NOR_SYM, HR_SJ_PHRASE, HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT HR_TO_DOMAIN_COUNT, HR_TO_NO_NAME, IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED SA_EXISTED, SN_EXISTED, SPF_NOPASS, DKIM_NOPASS, DMARC_NOPASS CIE_BAD, CIE_GOOD, CIE_GOOD_SPF, GTI_FG_BS, GTI_RG_INFO GTI_C_BU, AMN_GOOD, ABX_MISS_RDNS X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.19,REQID:a7f27a63-6371-4aba-812d-1b855c086a35,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:10 X-CID-INFO: VERSION:1.3.19,REQID:a7f27a63-6371-4aba-812d-1b855c086a35,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:10 X-CID-META: VersionHash:7db8b62,CLOUDID:bf6472fdb5e7bdb85b8bd762bb1b7550,BulkI D:2609111639293AHR2P2D,BulkQuantity:6,SF:17|19|38|66|78|81|82|102|127|136| 850|865|898,TC:nil,Content:0|15|50|99,EDM:-3|-100,IP:-2,URL:0,File:nil,RT: nil,Bulk:40,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0 ,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 7fc14c32adc211f19a56ed5b684f684d-20260911 X-User: liuzhe1@kylinos.cn Received: from localhost.localdomain [(223.70.159.239)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 35943435; Fri, 11 Sep 2026 17:23:50 +0800 From: Zhe Liu To: tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, corbet@lwn.net, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org Cc: skhan@linuxfoundation.org, rdunlap@infradead.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, dtcccc@linux.alibaba.com, changhuaixin@linux.alibaba.com, shanpeic@linux.alibaba.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Zhe Liu Subject: [PATCH v3 2/3] selftests: cgroup: test CPU quota and burst write order Date: Fri, 11 Sep 2026 17:22:57 +0800 Message-Id: <20260911092258.660771-3-liuzhe1@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260911092258.660771-1-liuzhe1@kylinos.cn> References: <20260911092258.660771-1-liuzhe1@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add regression coverage for the quota and burst write-order dependency. Verify that a burst configured with an unlimited quota is retained when switching to a finite quota, and that quota and burst can be updated in either order without changing the configured burst. Signed-off-by: Zhe Liu --- tools/testing/selftests/cgroup/test_cpu.c | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tools/testing/selftests/cgroup/test_cpu.c b/tools/testing/self= tests/cgroup/test_cpu.c index 735a53bb222b..243fc979a3e8 100644 --- a/tools/testing/selftests/cgroup/test_cpu.c +++ b/tools/testing/selftests/cgroup/test_cpu.c @@ -733,6 +733,45 @@ static int test_cpucg_max(const char *root) return ret; } =20 +static int test_cpucg_max_burst(const char *root) +{ + int ret =3D KSFT_FAIL; + char *cpucg; + + cpucg =3D cg_name(root, "cpucg_max_burst"); + if (!cpucg) + return KSFT_FAIL; + + if (cg_create(cpucg)) + goto cleanup; + + if (cg_write(cpucg, "cpu.max", "max 100000") || + cg_write(cpucg, "cpu.max.burst", "100000000") || + cg_write(cpucg, "cpu.max", "50000 100000") || + cg_read_strcmp(cpucg, "cpu.max.burst", "100000000\n")) + goto cleanup; + + if (cg_write(cpucg, "cpu.max.burst", "80000") || + cg_write(cpucg, "cpu.max", "100000 100000") || + cg_read_strcmp(cpucg, "cpu.max.burst", "80000\n")) + goto cleanup; + + if (cg_write(cpucg, "cpu.max.burst", "0") || + cg_write(cpucg, "cpu.max", "50000 100000") || + cg_write(cpucg, "cpu.max", "100000 100000") || + cg_write(cpucg, "cpu.max.burst", "80000") || + cg_read_strcmp(cpucg, "cpu.max.burst", "80000\n")) + goto cleanup; + + ret =3D KSFT_PASS; + +cleanup: + cg_destroy(cpucg); + free(cpucg); + + return ret; +} + /* * This test verifies that a process inside of a nested cgroup whose parent * group has a cpu.max value set, is properly throttled. @@ -822,6 +861,7 @@ struct cpucg_test { T(test_cpucg_nested_weight_overprovisioned), T(test_cpucg_nested_weight_underprovisioned), T(test_cpucg_max), + T(test_cpucg_max_burst), T(test_cpucg_max_nested), }; #undef T --=20 2.25.1 From nobody Fri Sep 25 14:32:11 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B25035E1CC; Fri, 11 Sep 2026 09:23:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789118646; cv=none; b=pJn5VIYGVT4H6bJsD2+aWV2Ns5xTvX0WGmejHjP4leZ5TCYeuBjV0oV/N4Pjc9itSqEF0wla94iEKE1XQEG9rtM0DNUPpbz509Y3cjh9vkloemY6HhjBEmrWSYB+dROzW32zO2+UOrNbgM0eNBElD+xi1h3MnYJVnduM1OdAjAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789118646; c=relaxed/simple; bh=Sfd8ZgRtiG55d4LBdYws7fViMlYKKVBDaZg+zx7RwXU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cB0XKxOwg0LQbd9+oxbk7xRezthYWVdrPM4gvk2+hn9KIM58PHXjiFRaRpAV+1Pw5dIfAozun2EHRdcKeQ9uPuRd9brUDHkwr1o3yOyOyUb/4vG/PUnQMHjLJJgU7gVwKtJzFHSlWizouNjP5sU7u0RJcdgyjje7qW2xKGgqMN4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 816ca6bcadc211f19a56ed5b684f684d-20260911 X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME, HR_CTE_8B HR_CTT_MISS, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_DIGIT_LEN HR_FROM_NAME, HR_SJ_DIGIT_LEN, HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER HR_SJ_NOR_SYM, HR_SJ_PHRASE, HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT HR_TO_DOMAIN_COUNT, HR_TO_NO_NAME, IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED SA_EXISTED, SN_EXISTED, SPF_NOPASS, DKIM_NOPASS, DMARC_NOPASS CIE_BAD, CIE_GOOD, CIE_GOOD_SPF, GTI_FG_BS, GTI_RG_INFO GTI_C_BU, AMN_GOOD, ABX_MISS_RDNS X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.19,REQID:cd898db3-aa58-4243-9f15-549dc5c5af81,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:10 X-CID-INFO: VERSION:1.3.19,REQID:cd898db3-aa58-4243-9f15-549dc5c5af81,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:10 X-CID-META: VersionHash:7db8b62,CLOUDID:d588ab34e2fae290c15b505d55a92e3c,BulkI D:260911163932ELB1A0S5,BulkQuantity:6,SF:17|19|38|66|78|81|82|102|127|136| 850|865|898,TC:nil,Content:0|15|50|99,EDM:-3|-100,IP:-2,URL:0,File:nil,RT: nil,Bulk:40,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0 ,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 816ca6bcadc211f19a56ed5b684f684d-20260911 X-User: liuzhe1@kylinos.cn Received: from localhost.localdomain [(223.70.159.239)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1964776151; Fri, 11 Sep 2026 17:23:53 +0800 From: Zhe Liu To: tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, corbet@lwn.net, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org Cc: skhan@linuxfoundation.org, rdunlap@infradead.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, dtcccc@linux.alibaba.com, changhuaixin@linux.alibaba.com, shanpeic@linux.alibaba.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Zhe Liu Subject: [PATCH v3 3/3] docs: cgroup-v2: document CPU quota and burst ordering Date: Fri, 11 Sep 2026 17:22:58 +0800 Message-Id: <20260911092258.660771-4-liuzhe1@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260911092258.660771-1-liuzhe1@kylinos.cn> References: <20260911092258.660771-1-liuzhe1@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document that quota and burst can be configured in either order, and that the configured burst is retained across quota changes while its runtime contribution is capped by the current quota. Signed-off-by: Zhe Liu --- Documentation/admin-guide/cgroup-v2.rst | 7 ++++++- Documentation/scheduler/sched-bwc.rst | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-= guide/cgroup-v2.rst index 86a2a0099178..e94285d48d0c 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1231,7 +1231,12 @@ will be referred to. All time durations are in micro= seconds. A read-write single value file which exists on non-root cgroups. The default is "0". =20 - The burst in the range [0, $MAX]. + The burst in microseconds, with a lower bound of 0 and an upper bound + independent of the current quota. The configured value is retained + when the quota changes and may be larger than the current quota. + During CFS runtime refill, the burst contribution is capped at the + current quota. The quota and burst files can therefore be written + in either order. =20 This file affects only processes under the fair-class scheduler and a BPF scheduler with the ``cgroup_set_bandwidth`` callback depending on what diff --git a/Documentation/scheduler/sched-bwc.rst b/Documentation/schedule= r/sched-bwc.rst index e881a945c188..19cd08195f6b 100644 --- a/Documentation/scheduler/sched-bwc.rst +++ b/Documentation/scheduler/sched-bwc.rst @@ -90,20 +90,22 @@ bandwidth restriction in place, such a group is describ= ed as an unconstrained bandwidth group. This represents the traditional work-conserving behavior = for CFS. =20 -Writing any (valid) positive value(s) no smaller than cpu.cfs_burst_us will -enact the specified bandwidth limit. The minimum quota allowed for the quo= ta or -period is 1ms. There is also an upper bound on the period length of 1s. -Additional restrictions exist when bandwidth limits are used in a hierarch= ical -fashion, these are explained in more detail below. +Writing any valid positive quota value will enact the specified bandwidth +limit. The minimum quota allowed for the quota or period is 1ms. There is +also an upper bound on the period length of 1s. Additional restrictions +exist when bandwidth limits are used in a hierarchical fashion, these are +explained in more detail below. =20 Writing any negative value to cpu.cfs_quota_us will remove the bandwidth l= imit and return the group to an unconstrained state once more. =20 A value of 0 for cpu.cfs_burst_us indicates that the group can not accumul= ate any unused bandwidth. It makes the traditional bandwidth control behavior = for -CFS unchanged. Writing any (valid) positive value(s) no larger than -cpu.cfs_quota_us into cpu.cfs_burst_us will enact the cap on unused bandwi= dth -accumulation. +CFS unchanged. A valid positive value written to cpu.cfs_burst_us is retai= ned +when the quota changes. If it is larger than the current quota, the burst +contribution during runtime refill is capped at the current quota. + +The quota and burst files can be updated in either order. =20 Any updates to a group's bandwidth specification will result in it becoming unthrottled if it is in a constrained state. @@ -243,4 +245,6 @@ Examples # echo 50000 > cpu.cfs_period_us /* period =3D 50ms */ # echo 10000 > cpu.cfs_burst_us /* burst =3D 10ms */ =20 - Larger buffer setting (no larger than quota) allows greater burst capac= ity. + A larger buffer setting allows greater burst capacity. If the configured + burst is larger than the quota, the burst contribution is capped at the + quota during runtime refill. --=20 2.25.1