<table><tr><td style="">graesslin created this revision.<br />graesslin added reviewers: KWin, Plasma.<br />Restricted Application added a project: KWin.<br />Restricted Application added subscribers: kwin, plasma-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8065" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The SCHED_RESET_ON_FORK results in threads (not only processes) to have<br />
the scheduling policy reset to default. This means that the libinput<br />
thread is not real time, but this was actually intended.</p>
<p>To solve this problem KWin does start without the RESET_ON_FORK flag<br />
during startup. Once createInput has been called the scheduling is<br />
adjusted again and RESET_ON_FORK is added again. This results in the<br />
libinput thread and all threads Qt starts in between (e.g. dbus) to gain<br />
real time policy. But it is still not leaked to other processes or to<br />
threads in KWin which don't need it.</p>
<p>Other options considered: just don't use RESET_ON_FORK and instead<br />
manually reset on fork. This would mean all threads in KWin gain real<br />
time, but we don't need this. It's only interesting for the main<br />
(rendering, Wayland thread) and the input thread. Also the danger to<br />
leak into another process is too high.</p>
<p>Keeping the capability till the libinput thread is created and adjust<br />
the thread itself. This option was discarded as I don't want KWin to<br />
have any capabilities when the QApplication is started.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>ps -eL -o class,rtprio,cmd,comm | grep kwin_wayland</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>libinput-rr</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8065" rel="noreferrer">https://phabricator.kde.org/D8065</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>input.cpp<br />
libinput/connection.cpp<br />
libinput/connection.h<br />
main_wayland.cpp</div></div></div><br /><div><strong>To: </strong>graesslin, KWin, Plasma<br /><strong>Cc: </strong>plasma-devel, kwin, bwowk, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart<br /></div>