[LTP] [PATCH] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems

Ma Xinjian maxj.fnst@fujitsu.com
Fri Aug 2 10:22:20 CEST 2024


The cpu, io, memory, and pids subsystems under the root cgroup cannot be disabled
because they are used for systemd. Currently, the test of cpu and memory subsystems
in cgroup_fj_function.sh and cgroup_fj_stress.sh will report the error
"echo: write error: device or resource busy".

Signed-off-by: Ma Xinjian <maxj.fnst@fujitsu.com>
---
 testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
index e866641ba..bb4318c51 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
@@ -77,7 +77,10 @@ common_cleanup()
 
     cgroup_cleanup
 
-    [ "$cgroup_version" = "2" ] && ROD echo "-$subsystem" \> "/sys/fs/cgroup/cgroup.subtree_control"
+    if [ "$cgroup_version" = "2" ] && [ "$subsystem" != "cpu" ] && [ "$subsystem" != "io" ] \
+            && [ "$subsystem" != "memory" ] && [ "$subsystem" != "pids" ]; then
+            ROD echo "-$subsystem" \> "/sys/fs/cgroup/cgroup.subtree_control"
+    fi
 }
 
 . cgroup_lib.sh
-- 
2.42.0



More information about the ltp mailing list