From f8c8cdec334a5eccb44e2a97004b1bb5115a02a2 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Wed, 12 Apr 2023 14:31:01 +0000 Subject: [PATCH] ftests-070: avoid enabling controller on leaf cgroup node cgroup v2, has no internal process constraint, where the process runs only on the leaf node of the cgroup hierarchy and no controllers should be enabled on the leaf cgroup node too. Let's not enable cpu controller on the leaf cgroup node. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka (cherry picked from commit 65c0b7025758d0802b81c0b42c194758316a2b18) --- tests/ftests/070-sudo-systemd_cgxget-cpu-settings-v2.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ftests/070-sudo-systemd_cgxget-cpu-settings-v2.py b/tests/ftests/070-sudo-systemd_cgxget-cpu-settings-v2.py index 81ebba6f..9e6fe05c 100755 --- a/tests/ftests/070-sudo-systemd_cgxget-cpu-settings-v2.py +++ b/tests/ftests/070-sudo-systemd_cgxget-cpu-settings-v2.py @@ -97,15 +97,14 @@ def setup(config): # With cgroup v2, we can't enable controller for the child cgroup, while # a task is attached to test070.scope. Attach the task from test070.scope - # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent - # and then in the SYSTEMD_CGNAME cgroup, so that the cgroup.get() works + # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent, + # so that the cgroup.get() works Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.procs', value=pid) Cgroup.set( config, cgname=(os.path.join(SLICE, SCOPE)), setting='cgroup.subtree_control', value='+cpu', ignore_systemd=True ) - Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.subtree_control', value='+cpu') # create and check if the cgroup was created under the controller root if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): -- 2.47.2