[LTP] [PATCH v2 1/3] tst_cgroup: add cpu.stat and cpu.weight to cgroup file table
Shaojie Sun
sunshaojie@kylinos.cn
Thu Jul 30 14:25:19 CEST 2026
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 <sunshaojie@kylinos.cn>
---
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 },
{ }
};
--
2.25.1
More information about the ltp
mailing list