FS#59988 - [kwin] kwin_wayland is not enabled as a real time process

Attached to Project: Arch Linux
Opened by rainer (raneon) - Saturday, 08 September 2018, 19:22 GMT
Last edited by Antonio Rojas (arojas) - Saturday, 08 September 2018, 20:58 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Kwin on Wayland is supposed to run as a real time process. If this is not done the user might suffer from input lags like a stuttering mouse cursor in some applications on Plasma Wayland. But Kwin is a compositor on Wayland, all input are handled by this process and as such it should not be in the same scheduling group as the other normal applications. THis is a packaging issue, for details see bug report: https://bugs.kde.org/show_bug.cgi?id=398391

Additional explanation: https://blog.martin-graesslin.com/blog/2017/09/kwinwayland-goes-real-time
Release notes: https://www.kde.org/announcements/plasma-5.12.0.php

Additional info:
* Plasma 5.13.5

$ ps -eL | grep kwin
1616 1616 tty2 00:00:01 kwin_wayland
1616 1620 tty2 00:00:00 kwin_wayla:cs0
1616 1621 tty2 00:00:00 kwin_wa:disk$0
1616 1622 tty2 00:00:00 kwin_wayla:sh0
1616 1623 tty2 00:00:00 kwin_wayla:sh1
1616 1624 tty2 00:00:00 kwin_wayla:sh2
1616 1625 tty2 00:00:00 kwin_wayla:sh3
1616 1626 tty2 00:00:00 kwin_wayla:sh4
1616 1627 tty2 00:00:00 kwin_wayla:sh5
1616 1628 tty2 00:00:00 kwin_wayla:sh6
1616 1629 tty2 00:00:00 kwin_wayla:sh7
1616 1630 tty2 00:00:00 kwin_wayla:sh8
1616 1631 tty2 00:00:00 kwin_wayla:sh9
1616 1632 tty2 00:00:00 kwin_wayla:sh10
1616 1633 tty2 00:00:00 kwin_wayla:sh11
1616 1634 tty2 00:00:00 kwin_way:shlo0
1616 1635 tty2 00:00:00 kwin_way:shlo1
1616 1636 tty2 00:00:00 kwin_way:shlo2
1616 1637 tty2 00:00:00 kwin_way:shlo3
1616 1638 tty2 00:00:00 kwin_way:shlo4
1616 1639 tty2 00:00:00 kwin_way:gdrv0
1616 1703 tty2 00:00:00 kwin_wayland
1679 1679 tty2 00:00:00 org_kde_kwin_xc

$ chrt -p 1616
Derzeitige Scheduling-Vorschrift für PID 1616: SCHED_OTHER
Derzeitige Scheduling-Priorität für PID 1616: 0

$ getcap -v /usr/bin/kwin_wayland
/usr/bin/kwin_wayland

Steps to reproduce:
1.) Run Plasma Wayland
2.) Check kwin_wayland SCHED policy, it is not CAP_SYS_NICE
This task depends upon

Closed by  Antonio Rojas (arojas)
Saturday, 08 September 2018, 20:58 GMT
Reason for closing:  Fixed
Additional comments about closing:  kwin 5.13.5-2
Comment by rainer (raneon) - Saturday, 08 September 2018, 19:33 GMT
The output of getcap should show CAP_SYS_NICE (this was not clear enough in my bug report). And I assume SCHED_FIFO would be correct.

The relevant paragraph from the blog post seems to be "So how is it done? KWin gained a new optional dependency on libcap and on installation sets the capability CAP_SYS_NICE on the kwin_wayland binary. @Distributions: please update your build deps. On startup kwin_wayland adjusts the scheduler policy to request SCHED_FIFO and drops the capability again before doing anything else.".

Comment by David Edmundson (d_ed) - Saturday, 08 September 2018, 20:21 GMT
Or to rephrase the above:

Please add libcap to the pkgbuild depends.
It's in core.

Comment by loqs (loqs) - Saturday, 08 September 2018, 20:24 GMT Comment by rainer (raneon) - Saturday, 08 September 2018, 20:25 GMT
libcap was installed already on my system, it may not be enough to add just the dependency in the pkgbuild. https://www.archlinux.org/packages/core/x86_64/libcap/
Comment by Antonio Rojas (arojas) - Saturday, 08 September 2018, 20:31 GMT
libcap is already a dependency, that's not the issue. The problem is that setcap only works as root, and makepkg builds packages as a regular user.
Comment by David Edmundson (d_ed) - Saturday, 08 September 2018, 20:44 GMT
You're right..

We fail silently, that's not good.
Turns out mine wasn't working :/

Will sort that part out upstream.

Loading...