* [LTP] [PATCH] cgroup_fj: don't disable controller that was already enabled
@ 2026-06-11 15:03 Andrea Cervesato
2026-06-11 18:17 ` [LTP] " linuxtestproject.agent
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Andrea Cervesato @ 2026-06-11 15:03 UTC (permalink / raw)
To: Linux Test Project
From: Andrea Cervesato <andrea.cervesato@suse.com>
On immutable distributions (and systemd-managed systems in general)
the cpuset controller is typically already enabled at the root cgroup
level. The cleanup tried to unconditionally disable it via
subtree_control, which failed with EBUSY because other system cgroups
were still using it, producing a spurious TWARN.
Save whether the controller was already enabled at root before
cgroup_require and skip the root-level disable in cleanup when it
was.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh | 10 +++++++++-
1 file changed, 9 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 153d351d7936effb15527620f565acaaed7ac747..8b5e73466ba32d2c66a2805a03f4d2136c16509b 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
@@ -57,6 +57,14 @@ create_subgroup()
common_setup()
{
+ # Check if the controller is already enabled at root before
+ # cgroup_require potentially enables it, so that cleanup does
+ # not disable a controller the system was already using.
+ if [ -f /sys/fs/cgroup/cgroup.subtree_control ] && \
+ grep -qw "$subsystem" /sys/fs/cgroup/cgroup.subtree_control; then
+ ctrl_was_enabled=1
+ fi
+
cgroup_require "$subsystem"
mount_point=$(cgroup_get_mountpoint "$subsystem")
start_path=$(cgroup_get_test_path "$subsystem")
@@ -77,7 +85,7 @@ common_cleanup()
cgroup_cleanup
- if [ "$cgroup_version" = "2" ]; then
+ if [ "$cgroup_version" = "2" ] && [ "$ctrl_was_enabled" != "1" ]; then
case "$subsystem" in
cpu|io|memory|pids)
:;;
---
base-commit: a375e8deed471723f5a0114c56eb48fe6f6f45d3
change-id: 20260611-fix_cgroup_immutable-2259f7591f8d
Best regards,
--
Andrea Cervesato <andrea.cervesato@suse.com>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] cgroup_fj: don't disable controller that was already enabled
2026-06-11 15:03 [LTP] [PATCH] cgroup_fj: don't disable controller that was already enabled Andrea Cervesato
@ 2026-06-11 18:17 ` linuxtestproject.agent
2026-06-12 9:04 ` [LTP] [PATCH] " Wei Gao via ltp
2026-06-12 9:40 ` Andrea Cervesato via ltp
2 siblings, 0 replies; 5+ messages in thread
From: linuxtestproject.agent @ 2026-06-11 18:17 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
Hi Andrea,
On Thu, 11 Jun 2026 17:03:41 +0200, Andrea Cervesato wrote:
> cgroup_fj: don't disable controller that was already enabled
Verdict: Reviewed
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] cgroup_fj: don't disable controller that was already enabled
2026-06-11 15:03 [LTP] [PATCH] cgroup_fj: don't disable controller that was already enabled Andrea Cervesato
2026-06-11 18:17 ` [LTP] " linuxtestproject.agent
@ 2026-06-12 9:04 ` Wei Gao via ltp
2026-06-12 9:18 ` Sebastian Chlad
2026-06-12 9:40 ` Andrea Cervesato via ltp
2 siblings, 1 reply; 5+ messages in thread
From: Wei Gao via ltp @ 2026-06-12 9:04 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: Linux Test Project
On Thu, Jun 11, 2026 at 05:03:41PM +0200, Andrea Cervesato wrote:
> From: Andrea Cervesato <andrea.cervesato@suse.com>
>
> On immutable distributions (and systemd-managed systems in general)
> the cpuset controller is typically already enabled at the root cgroup
> level. The cleanup tried to unconditionally disable it via
> subtree_control, which failed with EBUSY because other system cgroups
> were still using it, producing a spurious TWARN.
>
> Save whether the controller was already enabled at root before
> cgroup_require and skip the root-level disable in cleanup when it
> was.
>
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
> testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh | 10 +++++++++-
> 1 file changed, 9 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 153d351d7936effb15527620f565acaaed7ac747..8b5e73466ba32d2c66a2805a03f4d2136c16509b 100755
> --- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> +++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> @@ -57,6 +57,14 @@ create_subgroup()
>
> common_setup()
> {
> + # Check if the controller is already enabled at root before
> + # cgroup_require potentially enables it, so that cleanup does
> + # not disable a controller the system was already using.
> + if [ -f /sys/fs/cgroup/cgroup.subtree_control ] && \
> + grep -qw "$subsystem" /sys/fs/cgroup/cgroup.subtree_control; then
> + ctrl_was_enabled=1
> + fi
> +
> cgroup_require "$subsystem"
> mount_point=$(cgroup_get_mountpoint "$subsystem")
> start_path=$(cgroup_get_test_path "$subsystem")
> @@ -77,7 +85,7 @@ common_cleanup()
>
> cgroup_cleanup
>
> - if [ "$cgroup_version" = "2" ]; then
> + if [ "$cgroup_version" = "2" ] && [ "$ctrl_was_enabled" != "1" ]; then
> case "$subsystem" in
> cpu|io|memory|pids)
> :;;
>
> ---
> base-commit: a375e8deed471723f5a0114c56eb48fe6f6f45d3
> change-id: 20260611-fix_cgroup_immutable-2259f7591f8d
>
> Best regards,
> --
> Andrea Cervesato <andrea.cervesato@suse.com>
Reviewed-by: Wei Gao <wegao@suse.com>
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] cgroup_fj: don't disable controller that was already enabled
2026-06-12 9:04 ` [LTP] [PATCH] " Wei Gao via ltp
@ 2026-06-12 9:18 ` Sebastian Chlad
0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Chlad @ 2026-06-12 9:18 UTC (permalink / raw)
To: Wei Gao; +Cc: Linux Test Project
On Fri, 12 Jun 2026 at 11:04, Wei Gao via ltp <ltp@lists.linux.it> wrote:
> On Thu, Jun 11, 2026 at 05:03:41PM +0200, Andrea Cervesato wrote:
> > From: Andrea Cervesato <andrea.cervesato@suse.com>
> >
> > On immutable distributions (and systemd-managed systems in general)
> > the cpuset controller is typically already enabled at the root cgroup
> > level. The cleanup tried to unconditionally disable it via
> > subtree_control, which failed with EBUSY because other system cgroups
> > were still using it, producing a spurious TWARN.
> >
> > Save whether the controller was already enabled at root before
> > cgroup_require and skip the root-level disable in cleanup when it
> > was.
> >
> > Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> > ---
> > testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh | 10
> +++++++++-
> > 1 file changed, 9 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
> 153d351d7936effb15527620f565acaaed7ac747..8b5e73466ba32d2c66a2805a03f4d2136c16509b
> 100755
> > --- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> > +++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> > @@ -57,6 +57,14 @@ create_subgroup()
> >
> > common_setup()
> > {
> > + # Check if the controller is already enabled at root before
> > + # cgroup_require potentially enables it, so that cleanup does
> > + # not disable a controller the system was already using.
> > + if [ -f /sys/fs/cgroup/cgroup.subtree_control ] && \
> > + grep -qw "$subsystem" /sys/fs/cgroup/cgroup.subtree_control; then
> > + ctrl_was_enabled=1
> > + fi
> > +
> > cgroup_require "$subsystem"
> > mount_point=$(cgroup_get_mountpoint "$subsystem")
> > start_path=$(cgroup_get_test_path "$subsystem")
> > @@ -77,7 +85,7 @@ common_cleanup()
> >
> > cgroup_cleanup
> >
> > - if [ "$cgroup_version" = "2" ]; then
> > + if [ "$cgroup_version" = "2" ] && [ "$ctrl_was_enabled" != "1" ];
> then
> > case "$subsystem" in
> > cpu|io|memory|pids)
> > :;;
> >
> > ---
> > base-commit: a375e8deed471723f5a0114c56eb48fe6f6f45d3
> > change-id: 20260611-fix_cgroup_immutable-2259f7591f8d
> >
> > Best regards,
> > --
> > Andrea Cervesato <andrea.cervesato@suse.com>
> Reviewed-by: Wei Gao <wegao@suse.com>
>
Feel free to add:
Reviewed-by: Sebastian Chlad <sebastian.chlad@suse.com>
> >
> >
> > --
> > Mailing list info: https://lists.linux.it/listinfo/ltp
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] cgroup_fj: don't disable controller that was already enabled
2026-06-11 15:03 [LTP] [PATCH] cgroup_fj: don't disable controller that was already enabled Andrea Cervesato
2026-06-11 18:17 ` [LTP] " linuxtestproject.agent
2026-06-12 9:04 ` [LTP] [PATCH] " Wei Gao via ltp
@ 2026-06-12 9:40 ` Andrea Cervesato via ltp
2 siblings, 0 replies; 5+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-12 9:40 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: Linux Test Project
Merged, Thanks!
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-12 9:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11 15:03 [LTP] [PATCH] cgroup_fj: don't disable controller that was already enabled Andrea Cervesato
2026-06-11 18:17 ` [LTP] " linuxtestproject.agent
2026-06-12 9:04 ` [LTP] [PATCH] " Wei Gao via ltp
2026-06-12 9:18 ` Sebastian Chlad
2026-06-12 9:40 ` Andrea Cervesato via ltp
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.