Skip to content

RFC: wayland: Bump file descriptor limit to maximum value with systemd

Vlad Zahorodnii requested to merge work/zzag/nofile-limit into master

As a compositor, kwin has more open file descriptors than a normal application. After starting wayland session and opening a couple of apps kwin already has about 200 file descriptors open, which is almost a fifth of the soft file descriptor limit (1024), on my machine.

The main problem with RLIMIT_NOFILE limit is that it's inherited by child processes and bumping it to a value larger than 1024 can potentially break (arguably already broken) apps that use select().

Unfortunately, in-process kglobalacceld can spawn processes and it's not done in kwin code. It's a problem as we cannot restore the old NOFILE limit before exec(). On the other hand, kglobalacceld prefers kstart5 and klauncher5 over QProcess, which are usually available with plasma and allow starting apps that are completely detached from kwin process.

Xwayland should handle okay having more than 1024 file descriptors. The input method should too.

As a compromise, this change bumps the file descriptor limit only with systemd managed kwin, which is used by plasma.

cc #75 (closed)

Edited by Vlad Zahorodnii

Merge request reports