From 6ad52442fed71d7b53ad3c9583a8bf3f31b850a1 Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Mon, 31 Jan 2022 09:30:56 -0700 Subject: [PATCH] abstraction-map: Add (currently) unmappable cpu.stat Add an unmappable mapping for the cpu.stat setting. While the filename, cpu.stat, maps perfectly from v1 <-> v2, the contents do not. At this time, let's set this as unmappable and revisit it when we've thought through the best way to map the contents. Signed-off-by: Tom Hromatka Reviewed-by: Kamalesh Babulal --- src/abstraction-map.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/abstraction-map.c b/src/abstraction-map.c index 5e1c2c02..5c432146 100644 --- a/src/abstraction-map.c +++ b/src/abstraction-map.c @@ -32,9 +32,11 @@ #include "abstraction-map.h" const struct cgroup_abstraction_map cgroup_v1_to_v2_map[] = { + /* cpu controller */ {cgroup_convert_int, "cpu.shares", (void *)1024, "cpu.weight", (void *)100}, {cgroup_convert_cpu_quota_to_max, "cpu.cfs_quota_us", NULL, "cpu.max", NULL}, {cgroup_convert_cpu_period_to_max, "cpu.cfs_period_us", NULL, "cpu.max", NULL}, + {cgroup_convert_unmappable, "cpu.stat", NULL, "cpu.stat", NULL}, /* cpuset controller */ {cgroup_convert_name_only, "cpuset.effective_cpus", NULL, @@ -50,9 +52,11 @@ const int cgroup_v1_to_v2_map_sz = sizeof(cgroup_v1_to_v2_map) / sizeof(cgroup_v1_to_v2_map[0]); const struct cgroup_abstraction_map cgroup_v2_to_v1_map[] = { + /* cpu controller */ {cgroup_convert_int, "cpu.weight", (void *)100, "cpu.shares", (void *)1024}, {cgroup_convert_cpu_max_to_quota, "cpu.max", NULL, "cpu.cfs_quota_us", NULL}, {cgroup_convert_cpu_max_to_period, "cpu.max", NULL, "cpu.cfs_period_us", NULL}, + {cgroup_convert_unmappable, "cpu.stat", NULL, "cpu.stat", NULL}, /* cpuset controller */ {cgroup_convert_name_only, "cpuset.cpus.effective", NULL, -- 2.47.2