All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] cgroup_fj_commmon.sh: Avoid explicitly disabling controllers on cleanup
@ 2025-02-27 18:33 Cristian Marussi
  2025-02-28 13:06 ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Cristian Marussi @ 2025-02-27 18:33 UTC (permalink / raw)
  To: ltp; +Cc: aishwarya.tcv

The cgroup_cleanup helper, called by common_cleanup, takes already care
to remove/disable all the subsystems that were previously enabled using
the complementary cgroup_require helper, for the sake of testing.

Doing it also explicitly after cgroup_cleanup has been called, causes a
WARN that makes all cgroup_fj tests to fail.

  cgroup_fj_function 10 TINFO: Removing all ltp subgroups...
  tst_rod: Failed to open /sys/fs/cgroup/cgroup.subtree_control for writing: Read-only file system
  cgroup_fj_function 10 TWARN: echo -cpuset > /sys/fs/cgroup/cgroup.subtree_control failed

Observed on a Debian Bullseye with systemd using by default cgroup_V1:
in such a case the cgroup_require/cleanup helpers take care to create and
cleanup the cgroup_V2 needed by the testcase, but fail to cleamup for
the above reasons.

Cc: Petr Vorel <pvorel@suse.cz>
Cc: Ma Xinjian <maxj.fnst@fujitsu.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
Tried to add also cpuset to the set of skipped subsystem for cgroup_V2
and it worked but it did feel like the proper solution: digging a bit
into the cgroup helper and debugging the testcase I came to realize that
there was nothinhg to remove/disable left after cgroup_cleanup...

...thoughts ?
---
 .../kernel/controllers/cgroup_fj/cgroup_fj_common.sh      | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
index 153d351d7..6d5586534 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
@@ -76,14 +76,6 @@ common_cleanup()
     [ -d "$start_path" ] && find "$start_path" -depth -type d -exec rmdir '{}' \;
 
     cgroup_cleanup
-
-    if [ "$cgroup_version" = "2" ]; then
-        case "$subsystem" in
-        cpu|io|memory|pids)
-            :;;
-        *) ROD echo "-$subsystem" \> "/sys/fs/cgroup/cgroup.subtree_control";;
-        esac
-    fi
 }
 
 . cgroup_lib.sh
-- 
2.39.5


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-28 14:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-27 18:33 [LTP] [PATCH] cgroup_fj_commmon.sh: Avoid explicitly disabling controllers on cleanup Cristian Marussi
2025-02-28 13:06 ` Petr Vorel
2025-02-28 14:06   ` Cristian Marussi
2025-02-28 14:16     ` Cristian Marussi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.