From: Petr Vorel <pvorel@suse.cz>
To: Ma Xinjian <maxj.fnst@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems
Date: Thu, 8 Aug 2024 11:32:25 +0200 [thread overview]
Message-ID: <20240808093225.GA325801@pevik> (raw)
In-Reply-To: <20240802082220.890830-1-maxj.fnst@fujitsu.com>
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".
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> - [ "$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
I would personally wrote it as:
if [ "$cgroup_version" = "2" ]; then
case "$subsystem" in
cpu|io|memory|pid)
:;;
*) ROD echo "-$subsystem" \> "/sys/fs/cgroup/cgroup.subtree_control";;
esac
fi
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-08-08 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 8:22 [LTP] [PATCH] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems Ma Xinjian via ltp
2024-08-08 9:32 ` Petr Vorel [this message]
2024-08-09 7:35 ` Xinjian Ma (Fujitsu) via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240808093225.GA325801@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=maxj.fnst@fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox