* Re: [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/)
[not found] <20250605142943.229010-1-wegao@suse.com>
@ 2025-06-05 9:40 ` Petr Vorel
2025-06-05 11:17 ` Andrea Cervesato
2025-06-05 15:56 ` Michal Koutný
0 siblings, 2 replies; 6+ messages in thread
From: Petr Vorel @ 2025-06-05 9:40 UTC (permalink / raw)
To: Wei Gao; +Cc: ltp, Michal Koutný, Li Wang, cgroups
Hi Wei, all,
> When the CONFIG_RT_GROUP_SCHED=y config is set, test cases like sched_rr_get_interval01
> will failed since limitation of RT processes with cgroup v2 cpu controller.
> The limitation is RT processes have to be in the root cgroup before enabling cpu controller.
> By default the shell will not running in root cgroup "0::/" since systemd will put shell
> into 0::/user.slice/user-xx.slice/session-xx.scope, so ltp case run within shell will failed.
> We can use this patch to workaround above limitation. If we agree on this patch, i will
> continue do same patch to following cases:
> sched_rr_get_interval02
> sched_rr_get_interval03
> sched_setparam02
> sched_getscheduler01
Acked-by: Petr Vorel <pvorel@suse.cz>
LGTM.
@Michal @Li WDYT?
Kind regards,
Petr
> Fixes: https://github.com/linux-test-project/ltp/issues/1245
> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
> .../sched_rr_get_interval/sched_rr_get_interval01.c | 6 ++++++
> 1 file changed, 6 insertions(+)
> diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
> index b4d75bdcc..55516ec89 100644
> --- a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
> +++ b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
> @@ -43,6 +43,12 @@ static void setup(void)
> tp.type = tv->ts_type;
> + if (access("/sys/fs/cgroup/cgroup.controllers", F_OK) == 0) {
> + int pid = getpid();
> +
> + SAFE_FILE_PRINTF("/sys/fs/cgroup/cgroup.procs", "%d", pid);
> + }
> +
> if ((sys_sched_setscheduler(0, SCHED_RR, &p)) == -1)
> tst_res(TFAIL | TERRNO, "sched_setscheduler() failed");
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/)
2025-06-05 9:40 ` [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/) Petr Vorel
@ 2025-06-05 11:17 ` Andrea Cervesato
2025-06-05 15:56 ` Michal Koutný
1 sibling, 0 replies; 6+ messages in thread
From: Andrea Cervesato @ 2025-06-05 11:17 UTC (permalink / raw)
To: Petr Vorel, Wei Gao; +Cc: cgroups, Michal Koutný, ltp
Merged, thanks.
- Andrea
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/)
2025-06-05 9:40 ` [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/) Petr Vorel
2025-06-05 11:17 ` Andrea Cervesato
@ 2025-06-05 15:56 ` Michal Koutný
2025-06-07 18:42 ` Wei Gao
1 sibling, 1 reply; 6+ messages in thread
From: Michal Koutný @ 2025-06-05 15:56 UTC (permalink / raw)
To: Petr Vorel; +Cc: Wei Gao, ltp, Li Wang, cgroups
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
On Thu, Jun 05, 2025 at 11:40:19AM +0200, Petr Vorel <pvorel@suse.cz> wrote:
> @Michal @Li WDYT?
RT_GROUP scheduling is v1 feature as of now.
Testing cgroup v2 makes only sense with
CONFIG_RT_GROUP_SCHED=y and CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED=y
(this combination is equivalent to CONFIG_RT_GROUP_SCHED=n on v2).
HTH,
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/)
2025-06-05 15:56 ` Michal Koutný
@ 2025-06-07 18:42 ` Wei Gao
2025-06-09 11:44 ` Michal Koutný
0 siblings, 1 reply; 6+ messages in thread
From: Wei Gao @ 2025-06-07 18:42 UTC (permalink / raw)
To: Michal Koutný; +Cc: Petr Vorel, ltp, Li Wang, cgroups
On Thu, Jun 05, 2025 at 05:56:11PM +0200, Michal Koutný wrote:
> On Thu, Jun 05, 2025 at 11:40:19AM +0200, Petr Vorel <pvorel@suse.cz> wrote:
> > @Michal @Li WDYT?
>
> RT_GROUP scheduling is v1 feature as of now.
>
> Testing cgroup v2 makes only sense with
> CONFIG_RT_GROUP_SCHED=y and CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED=y
> (this combination is equivalent to CONFIG_RT_GROUP_SCHED=n on v2).
@Michal Koutný So we should skip test cgroupv2 with CONFIG_RT_GROUP_SCHED=yes, correct? Like following change?
diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
index 55516ec89..b12bd7857 100644
--- a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
+++ b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
@@ -43,10 +43,9 @@ static void setup(void)
tp.type = tv->ts_type;
+ static const char * const kconf[] = {"CONFIG_RT_GROUP_SCHED=y", NULL};
+ if ((access("/sys/fs/cgroup/cgroup.controllers", F_OK) == 0) && !tst_kconfig_check(kconf_strict)) {
+ tst_brk(TCONF, "CONFIG_RT_GROUP_SCHED not support on cgroupv2");
+ }
>
> HTH,
> Michal
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/)
2025-06-07 18:42 ` Wei Gao
@ 2025-06-09 11:44 ` Michal Koutný
2025-06-09 13:33 ` Petr Vorel
0 siblings, 1 reply; 6+ messages in thread
From: Michal Koutný @ 2025-06-09 11:44 UTC (permalink / raw)
To: Wei Gao; +Cc: Petr Vorel, ltp, Li Wang, cgroups
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
On Sat, Jun 07, 2025 at 02:42:22PM -0400, Wei Gao <wegao@suse.com> wrote:
> @Michal Koutný So we should skip test cgroupv2 with CONFIG_RT_GROUP_SCHED=yes, correct?
Ideally, no one should run v2 with CONFIG_RT_GROUP_SCHED=y, so this
would never fail :-p
> Like following change?
But if there are such poor souls, that skip should make the test not
obstruct the rest of LTP.
Thanks,
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/)
2025-06-09 11:44 ` Michal Koutný
@ 2025-06-09 13:33 ` Petr Vorel
0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2025-06-09 13:33 UTC (permalink / raw)
To: Michal Koutný; +Cc: Wei Gao, ltp, Li Wang, cgroups
Hi all,
> On Sat, Jun 07, 2025 at 02:42:22PM -0400, Wei Gao <wegao@suse.com> wrote:
> > @Michal Koutný So we should skip test cgroupv2 with CONFIG_RT_GROUP_SCHED=yes, correct?
> Ideally, no one should run v2 with CONFIG_RT_GROUP_SCHED=y, so this
> would never fail :-p
@Michal thanks for a clarification. It's default n and
Documentation/scheduler/sched-rt-group.rst which mentions CONFIG_RT_GROUP_SCHED
also mentions Documentation/admin-guide/cgroup-v1/cgroups.rst, that should be a
good hint for people changing the defaults :).
Also, there are 3 old mips and sh boards which set CONFIG_RT_GROUP_SCHED=y.
Probably nobody cares much nowadays, but maybe it should be deleted.
> > Like following change?
> But if there are such poor souls, that skip should make the test not
> obstruct the rest of LTP.
@Andrea, you claimed it's merged, but maybe you reply to a wrong thread
because it's not merged.
https://lore.kernel.org/ltp/b15fa0cb-e893-4642-9aa0-05f732b75131@suse.com/
I agree with Cyril to have a custom function in lib/tst_cgroup.c, which would be
called by affected tests.
Kind regards,
Petr
> Thanks,
> Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-09 13:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250605142943.229010-1-wegao@suse.com>
2025-06-05 9:40 ` [LTP] [PATCH v1] sched_rr_get_interval01.c: Put test process into absolute root cgroup (0::/) Petr Vorel
2025-06-05 11:17 ` Andrea Cervesato
2025-06-05 15:56 ` Michal Koutný
2025-06-07 18:42 ` Wei Gao
2025-06-09 11:44 ` Michal Koutný
2025-06-09 13:33 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).