Re: [systemd-devel] Real-time scheduling doesn't work with StartupCPUWeight/CPUWeight

2022-09-20 Thread Robert Tiemann
On 9/17/22 18:01, Lennart Poettering wrote:

> Please consult README, look for comment on CONFIG_RT_GROUP_SCHED=n.

Wow, thank you! Disabling group scheduling for realtime tasks did the trick.

> Lennart

Cheers,
Robert


Re: [systemd-devel] Real-time scheduling doesn't work with StartupCPUWeight/CPUWeight

2022-09-17 Thread Lennart Poettering
On Mi, 14.09.22 15:03, Robert Tiemann (r...@gmx.de) wrote:

> Hi!
>
> I have optimized boot times for an embedded system by setting
> StartupCPUWeight= and CPUWeight= for a few services. The startup
> values are set to various values. All unit files I have touched also
> contain the line "CPUWeight=100" so that the system is running with
> defaults after startup. Some unit files contain Nice= assignments
> (placed there before my optimizations, so I kept them in place).
>
> Now, the problem is with one process in the system which requires
> real-time priorities. It calls pthread_setschedparam() to configure
> two of its threads for SCHED_RR policy at priority 99. This used to
> work before my optimizations, but now pthread_setschedparam() fails
> with EPERM error. I have added LimitRTPRIO=infinity, but it still
> doesn't work. The threads are created and configured after the startup
> phase has finished.

Please consult README, look for comment on CONFIG_RT_GROUP_SCHED=n.

Lennart

--
Lennart Poettering, Berlin


[systemd-devel] Real-time scheduling doesn't work with StartupCPUWeight/CPUWeight

2022-09-14 Thread Robert Tiemann
Hi!

I have optimized boot times for an embedded system by setting
StartupCPUWeight= and CPUWeight= for a few services. The startup
values are set to various values. All unit files I have touched also
contain the line "CPUWeight=100" so that the system is running with
defaults after startup. Some unit files contain Nice= assignments
(placed there before my optimizations, so I kept them in place).

Now, the problem is with one process in the system which requires
real-time priorities. It calls pthread_setschedparam() to configure
two of its threads for SCHED_RR policy at priority 99. This used to
work before my optimizations, but now pthread_setschedparam() fails
with EPERM error. I have added LimitRTPRIO=infinity, but it still
doesn't work. The threads are created and configured after the startup
phase has finished.

Removing the StartupCPUWeight= and CPUWeight= lines from all unit
files allows pthread_setschedparam() to succeed. It starts failing
when setting StartupCPUWeight= even for a single, unrelated service.

How can I have an optimized startup and still have real-time
priorities in that process?

The system is running systemd 250.5.

Best regards,
Robert