public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems
@ 2024-08-09  7:30 Ma Xinjian via ltp
  2024-08-09  8:45 ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Ma Xinjian via ltp @ 2024-08-09  7:30 UTC (permalink / raw)
  To: ltp

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>
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
-- 
2.42.0


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

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

* Re: [LTP] [PATCH v2] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems
  2024-08-09  7:30 [LTP] [PATCH v2] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems Ma Xinjian via ltp
@ 2024-08-09  8:45 ` Petr Vorel
  2024-08-09  8:52   ` Xinjian Ma (Fujitsu) via ltp
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2024-08-09  8:45 UTC (permalink / raw)
  To: Ma Xinjian; +Cc: ltp

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

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

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

* Re: [LTP] [PATCH v2] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems
  2024-08-09  8:45 ` Petr Vorel
@ 2024-08-09  8:52   ` Xinjian Ma (Fujitsu) via ltp
  2024-08-09 10:31     ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Xinjian Ma (Fujitsu) via ltp @ 2024-08-09  8:52 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp@lists.linux.it

> 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?

Hi Petr

It fails on Fedora 37 which uses cgroupv2.
cgroupv1 won't trigger this failure.

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

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

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

* Re: [LTP] [PATCH v2] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems
  2024-08-09  8:52   ` Xinjian Ma (Fujitsu) via ltp
@ 2024-08-09 10:31     ` Petr Vorel
  2024-08-21 19:58       ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2024-08-09 10:31 UTC (permalink / raw)
  To: Xinjian Ma (Fujitsu); +Cc: ltp@lists.linux.it

> > 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?

> Hi Petr

> It fails on Fedora 37 which uses cgroupv2.
> cgroupv1 won't trigger this failure.

OK, thx for info, merged!

I managed to reproduce the same issue also on Debian trixie or some Alpine
(which don't use systemd).  I still wonder what could be the root cause, because
many other systemd based systems have no problem (various SLES versions and
openSUSE Tumbleweed).

Kind regards,
Petr

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

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

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

* Re: [LTP] [PATCH v2] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems
  2024-08-09 10:31     ` Petr Vorel
@ 2024-08-21 19:58       ` Petr Vorel
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2024-08-21 19:58 UTC (permalink / raw)
  To: Xinjian Ma (Fujitsu), ltp@lists.linux.it

Hi Ma,

...
> OK, thx for info, merged!

I'm sorry, I by accident merged v1 instead of v2. Therefore I merged code from
v2 under your name.

Kind regards,
Petr

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

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

end of thread, other threads:[~2024-08-21 19:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09  7:30 [LTP] [PATCH v2] cgroup_fj_common.sh: Do not disable systemd related cgroup subsystems Ma Xinjian via ltp
2024-08-09  8:45 ` Petr Vorel
2024-08-09  8:52   ` Xinjian Ma (Fujitsu) via ltp
2024-08-09 10:31     ` Petr Vorel
2024-08-21 19:58       ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox