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

Petr Vorel pvorel@suse.cz
Fri Aug 9 10:45:27 CEST 2024


Hi Ma,

> 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".

Could you please share a bit of info on which system it fails. Do you use cgroup v1?

Kind regards,
Petr

> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Ma Xinjian <maxj.fnst@fujitsu.com>
> ---
>  .../kernel/controllers/cgroup_fj/cgroup_fj_common.sh      | 8 +++++++-
>  1 file changed, 7 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..153d351d7 100755
> --- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> +++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> @@ -77,7 +77,13 @@ common_cleanup()

>      cgroup_cleanup

> -    [ "$cgroup_version" = "2" ] && ROD echo "-$subsystem" \> "/sys/fs/cgroup/cgroup.subtree_control"
> +    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


More information about the ltp mailing list