]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
abstraction: map cpu.cfs_burst_us to cpu.max.burst
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 29 Apr 2026 07:52:59 +0000 (13:22 +0530)
committerTom Hromatka (Oracle) <tom.hromatka@gmail.com>
Tue, 26 May 2026 14:55:14 +0000 (08:55 -0600)
Add symmetric abstraction-mapping entries for burst quota translation:
  - v1 -> v2: cpu.cfs_burst_us -> cpu.max.burst
  - v2 -> v1: cpu.max.burst -> cpu.cfs_burst_us

Both knobs represent CFS burst runtime budget in microseconds, so the
conversion is intentionally name-only (no scaling or unit transform).
This differs from cpu.shares <-> cpu.weight, where range scaling is
required, and from cpu.max <-> cfs_{quota,period}, which needs tuple
packing/unpacking logic.

With this mapping, converted cgroups preserve explicit burst settings
instead of dropping them as unmapped cpu attributes.

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

index 3b1758bb468994f57ab6c12fc216d68cf20587ec..dac98b4d24a8fe7ea27c538a95da297b31554f08 100644 (file)
@@ -21,6 +21,7 @@
 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_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_unmappable, "cpu.stat", NULL, "cpu.stat", NULL},
@@ -53,6 +54,7 @@ const int cgroup_v1_to_v2_map_sz = ARRAY_SIZE(cgroup_v1_to_v2_map);
 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_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_unmappable, "cpu.stat", NULL, "cpu.stat", NULL},