aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2022-05-13 20:30:19 +0200
committerFurkan Sahin <furkan-dev@proton.me>2022-05-13 20:30:19 +0200
commit0052e57647ace3ba0c585734ef7f1648d7e24949 (patch)
treefe28dbc19271b9dce54f7433a86bab0073fe8ca9 /include
parent37317774d00e58806073b087244b1d23bd9c67dc (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/sway/server.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sway/server.h b/include/sway/server.h
index d8ccd64f..3d59ca56 100644
--- a/include/sway/server.h
+++ b/include/sway/server.h
@@ -173,4 +173,6 @@ void handle_pointer_constraint(struct wl_listener *listener, void *data);
void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
void *data);
+void set_rr_scheduling(void);
+
#endif