]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
abstraction: preserve cpu.idle across v1/v2 conversion
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 1 May 2026 07:53:30 +0000 (13:23 +0530)
committerTom Hromatka (Oracle) <tom.hromatka@gmail.com>
Tue, 26 May 2026 14:55:14 +0000 (08:55 -0600)
Add symmetric passthrough mappings for cpu.idle in both abstraction
tables so conversion retains the explicit idle scheduling policy knob.

cpu.idle is exposed with the same key and textual value semantics on
supported kernels in both cgroups version with no range scaling or tuple
synthesis is needed. A direct passthrough is therefore the least lossy
conversion.

Without this entry, cpu.idle was treated as unmappable and dropped when
crossing hierarchy versions, causing converted cgroups to lose scheduler
policy intent.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
src/abstraction-map.c

index dac98b4d24a8fe7ea27c538a95da297b31554f08..906038279fdfae0408dc80533219e52345707b4c 100644 (file)
@@ -24,6 +24,7 @@ const struct cgroup_abstraction_map cgroup_v1_to_v2_map[] = {
        {cgroup_convert_name_only, "cpu.cfs_burst_us", NULL, "cpu.max.burst", NULL},
        {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_passthrough, "cpu.idle", NULL, "cpu.idle", NULL},
        {cgroup_convert_unmappable, "cpu.stat", NULL, "cpu.stat", NULL},
 
        /* cpuset controller */
@@ -57,6 +58,7 @@ const struct cgroup_abstraction_map cgroup_v2_to_v1_map[] = {
        {cgroup_convert_name_only, "cpu.max.burst", NULL, "cpu.cfs_burst_us", NULL},
        {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_passthrough, "cpu.idle", NULL, "cpu.idle", NULL},
        {cgroup_convert_unmappable, "cpu.stat", NULL, "cpu.stat", NULL},
 
        /* cpuset controller */