]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests/cgroup: Add support for favordynmods
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Sun, 9 Jun 2024 11:33:57 +0000 (17:03 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 11 Jun 2024 15:05:37 +0000 (09:05 -0600)
Upstream Linux Kernel commit 81d3a5be05d3 ("cgroup: add
cgroup_favordynmods= command-line option") introduced
CONFIG_CGROUP_FAVOR_DYNMODS, that would append favordynmods to the mount
options on cgroup v1. This patch strips that option.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tests/ftests/cgroup.py

index 7a73fa6ecc69ff18adb15dee65866a40d5e2557e..09b426f16f657d8fef87efdae4621ac8236668f5 100644 (file)
@@ -39,6 +39,12 @@ class CgroupMount(object):
             if self.version == CgroupVersion.CGROUP_V1:
                 self.controller = entries[3].split(',')[-1]
 
+                # kernel's compiled with CONFIG_CGROUP_FAVOR_DYNMODS on
+                # cgroup v1 will append mount points with favordynmods,
+                # remove it.
+                if self.controller == 'favordynmods':
+                    self.controller == entries[3].split(',')[-2]
+
                 if self.controller == 'clone_children':
                     # the cpuset controller may append this option to the end
                     # rather than the controller name like all other controllers