mirror of
https://github.com/swaywm/sway.git
synced 2026-04-14 08:22:08 -04:00
realtime: request SCHED_RR using CAP_SYS_NICE
Try to gain SCHED_RR (round-robin) realtime scheduling privileges before starting the server. This requires CAP_SYS_NICE on Linux systems. We additionally register a pthread_atfork callback which resets the scheduling class back to SCHED_OTHER (the Linux system default). Due to CAP_SYS_NICE, setting RLIMIT_RTPRIO has no effect on the process as documented within man 7 sched (from Linux): Privileged (CAP_SYS_NICE) threads ignore the RLIMIT_RTPRIO limit; as with older kernels, they can make arbitrary changes to scheduling policy and priority. See getrlimit(2) for further information on RLIMIT_RTPRIO Note that this requires the sway distribution packagers to set the CAP_SYS_NICE capability on the sway binary. Supersedes #6992
This commit is contained in:
parent
3f600565e4
commit
a3a82efbf6
4 changed files with 45 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ sway_sources = files(
|
|||
'ipc-server.c',
|
||||
'lock.c',
|
||||
'main.c',
|
||||
'realtime.c',
|
||||
'server.c',
|
||||
'swaynag.c',
|
||||
'xdg_activation_v1.c',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue