[LTP] [PATCH v3 1/3] tst_cgroup: add cpu.stat and cpu.weight to cgroup file table

Shaojie Sun <[email protected]> Fri, 31 Jul 2026 11:13:41 +0800
Newsgroups it.linux.lists.ltp
Message-ID <[email protected]>
These entries are needed by the upcoming CPU cgroup v2 tests
(cgroup_cpu01 through cgroup_cpu05) to read cpu.stat and set
cpu.weight on cgroups.

Note: cpu.stat also exists in cgroup v1, so the v1 name is
specified as "cpu.stat" (same as v2). cpu.weight is v2-only
(NULL for v1) because its v1 counterpart cpu.shares uses a
different scale and cannot be aliased.

Signed-off-by: Shaojie Sun <[email protected]>
---
 lib/tst_cgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tst_cgroup.c b/lib/tst_cgroup.c
index 7c6ecd4d2..0ab072db7 100644
--- a/lib/tst_cgroup.c
+++ b/lib/tst_cgroup.c
@@ -199,6 +199,8 @@ static const struct cgroup_file cpu_ctrl_files[] = {
 	 */
 	{ "cpu.max", "cpu.cfs_quota_us", CTRL_CPU },
 	{ "cpu.cfs_period_us", "cpu.cfs_period_us", CTRL_CPU },
+	{ "cpu.stat", "cpu.stat", CTRL_CPU },
+	{ "cpu.weight", NULL, CTRL_CPU },
 	{ }
 };
 

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp