[systemd-devel] Antw: [EXT] Re: [systemd‑devel] cgroupsv2 and realtime processes

2022-06-06 Thread Ulrich Windl
>>> Michal Koutný  schrieb am 06.06.2022 um 18:29 in
Nachricht
<20220606162925.gh6...@blackbody.suse.cz>:
> On Mon, Jun 06, 2022 at 05:59:32PM +0200, Michał Zegan 

> wrote:
>> I assume if it would be on it would break any and all realtime
>> usage...?
> 
> Most likely (you'd not be able either: turn on RT policy, migrate the
> process or enable CPU controller, i.e. a step that'd lead to an invalid
> state).
> 
> I'm curious, what would be your use case for turning RT group
> schedulling on?

Odd experiments? ;-)

> 
> Thanks,
> Michal





Re: [systemd-devel] cgroupsv2 and realtime processes

2022-06-06 Thread Michał Zegan


W dniu 6.06.2022 o 18:29, Michal Koutný pisze:

On Mon, Jun 06, 2022 at 05:59:32PM +0200, Michał Zegan  
wrote:

I assume if it would be on it would break any and all realtime
usage...?

Most likely (you'd not be able either: turn on RT policy, migrate the
process or enable CPU controller, i.e. a step that'd lead to an invalid
state).

I'm curious, what would be your use case for turning RT group
schedulling on?


I don't necessarily have any usecase, I just forgot that option was even 
configurable. Even though i knew about it's existence previously.


Arch disables it by default and this seems to be a good choice. but 
cgroupsv2 docs don't say that this behavior is conditioned on that 
option so I forgot it existed.




Thanks,
Michal


OpenPGP_0xE6516A8A8E25955D.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: [systemd-devel] cgroupsv2 and realtime processes

2022-06-06 Thread Michal Koutný
On Mon, Jun 06, 2022 at 05:59:32PM +0200, Michał Zegan  
wrote:
> I assume if it would be on it would break any and all realtime
> usage...?

Most likely (you'd not be able either: turn on RT policy, migrate the
process or enable CPU controller, i.e. a step that'd lead to an invalid
state).

I'm curious, what would be your use case for turning RT group
schedulling on?

Thanks,
Michal


Re: [systemd-devel] cgroupsv2 and realtime processes

2022-06-06 Thread Michał Zegan


W dniu 6.06.2022 o 17:14, Michal Koutný pisze:

On Mon, Jun 06, 2022 at 04:54:03PM +0200, Michał Zegan  
wrote:

this note pointed to in the readme is quite cgroups v1 specific, I believe
what it describes was true in v1, and v2 does not have any capability to
control realtime processes in non root cgroups if I read correctly.

Yes. And it extends to v2 too where there are even no userspace knobs to
configure the RT attributes.

Therefore it works [1] with CONFIG_RT_GROUP_SCHED unset since RT
processes remain in the root cgroup (it's an implementation detail you
won't see from /proc/$pid/cgroup, where is still the regular process
membership).
To prevent confusion -- this applies only to processes (threads) with RT
policy and from all other perspectives these processes (threads) are
still in the listed cgroup.

Does that explain what you were after?
yes. forgot about that option to be fair. I assume if it would be on it 
would break any and all realtime usage...?


Michal

[1] Unless your goal is to control per-cgroup RT attributes. I
understood you just wanted to be able to place RT processes into
non-root cgroups.


OpenPGP_0xE6516A8A8E25955D.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: [systemd-devel] cgroupsv2 and realtime processes

2022-06-06 Thread Michal Koutný
On Mon, Jun 06, 2022 at 04:54:03PM +0200, Michał Zegan  
wrote:
> this note pointed to in the readme is quite cgroups v1 specific, I believe
> what it describes was true in v1, and v2 does not have any capability to
> control realtime processes in non root cgroups if I read correctly.

Yes. And it extends to v2 too where there are even no userspace knobs to
configure the RT attributes.

Therefore it works [1] with CONFIG_RT_GROUP_SCHED unset since RT
processes remain in the root cgroup (it's an implementation detail you
won't see from /proc/$pid/cgroup, where is still the regular process
membership).
To prevent confusion -- this applies only to processes (threads) with RT
policy and from all other perspectives these processes (threads) are
still in the listed cgroup.

Does that explain what you were after?

Michal

[1] Unless your goal is to control per-cgroup RT attributes. I
understood you just wanted to be able to place RT processes into
non-root cgroups.


Re: [systemd-devel] cgroupsv2 and realtime processes

2022-06-06 Thread Michał Zegan


W dniu 6.06.2022 o 16:02, Michal Koutný pisze:

Hello Michał.

On Sun, Jun 05, 2022 at 03:28:23PM +0200, Michał Zegan  
wrote:

I have kernel 5.17 on archlinux.

How is your kernel configured wrt CONFIG_RT_GROUP_SCHED?

it is unset



Is that still true?

That depends :-)


Yet, checking /proc/(pid)/cgroup states these processes are not in a root
cgroup, yet the cpu controller is enabled on the root cgroup
(/sys/fs/cgroup/cgroup.subtree_control lists "cpu" as one of the controllers
and I see the interface files in children).

Can anyone explain the situation?

With v2 and CONFIG_RT_GROUP_SCHED there's no way how to assign realtime
budgets to cgroups and therefore realtime tasks cannot run in them.

With !CONFIG_RT_GROUP_SCHED, there's (internally) only the root cgroup
for realtime tasks and things apparently work.

See also [1].
this note pointed to in the readme is quite cgroups v1 specific, I 
believe what it describes was true in v1, and v2 does not have any 
capability to control realtime processes in non root cgroups if I read 
correctly.




The cgroupsv2 documentation states that cgroup cpu controller
currently does not support realtime processes, so to enable it all
realtime processes must be moved to root cgroup.

Will you send a docs patch with the CONFIG_RT_GROUP_SCHED reservation?
:-p

HTH,
Michal

[1] 
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsystemd%2Fsystemd%2Fblob%2F369151c9c73b12fb7a88fc2b558499c2d4832982%2FREADME%23L140&data=05%7C01%7C%7C2497332c429b4459b16308da47c5367e%7C84df9e7fe9f640afb435%7C1%7C0%7C637901209614621463%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dXYxa0cDT48qoJDUwJKA%2B2d7vBLYxdc1TuZztaQqQWI%3D&reserved=0


OpenPGP_0xE6516A8A8E25955D.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: [systemd-devel] cgroupsv2 and realtime processes

2022-06-06 Thread Michal Koutný
Hello Michał.

On Sun, Jun 05, 2022 at 03:28:23PM +0200, Michał Zegan  
wrote:
> I have kernel 5.17 on archlinux.

How is your kernel configured wrt CONFIG_RT_GROUP_SCHED?

> Is that still true?

That depends :-)

> Yet, checking /proc/(pid)/cgroup states these processes are not in a root
> cgroup, yet the cpu controller is enabled on the root cgroup
> (/sys/fs/cgroup/cgroup.subtree_control lists "cpu" as one of the controllers
> and I see the interface files in children).
> 
> Can anyone explain the situation?

With v2 and CONFIG_RT_GROUP_SCHED there's no way how to assign realtime
budgets to cgroups and therefore realtime tasks cannot run in them.

With !CONFIG_RT_GROUP_SCHED, there's (internally) only the root cgroup
for realtime tasks and things apparently work.

See also [1].

> 
> The cgroupsv2 documentation states that cgroup cpu controller
> currently does not support realtime processes, so to enable it all
> realtime processes must be moved to root cgroup.

Will you send a docs patch with the CONFIG_RT_GROUP_SCHED reservation?
:-p

HTH,
Michal

[1] 
https://github.com/systemd/systemd/blob/369151c9c73b12fb7a88fc2b558499c2d4832982/README#L140