Skip to content

Commit

Permalink
cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems
Browse files Browse the repository at this point in the history
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 on same
systems (Fedora 37, Debian trixie) an error:

    echo: write error: Device or resource busy
    cgroup_fj_function 10 TWARN: echo -cpu > /sys/fs/cgroup/cgroup.subtree_control failed

Link: https://lore.kernel.org/ltp/[email protected]/
Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Ma Xinjian <[email protected]>
  • Loading branch information
MaXinjian authored and pevik committed Aug 9, 2024
1 parent 863c7d2 commit 6e13426
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6e13426

Please sign in to comment.