Summary: | kwin do not get realtime capabilities on musl | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Mehmet Karataş <kingfared> |
Component: | performance | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alice, kde, nate |
Priority: | LO | ||
Version: | master | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/kwin/-/commit/2b7882fbbc734101b097b7b7b019197386769eb1 | Version Fixed In: | 6.1.4 |
Sentry Crash Report: | |||
Attachments: | fix-kwin-realtime-thread-musl.patch |
Description
Mehmet Karataş
2024-06-03 21:24:30 UTC
From your link: The reason it doesn't do anything is that Linux does not provide a way to set scheduling parameters for a _process_, only for threads. The sched_setscheduler syscall is documented as taking a pid but actually takes a thread id and only operates on that thread. glibc just ignores this and provides sched_* functions that do the wrong thing. Fortunately there's an easy fix: use pthread_setschedparam, and pthread_self to get the pthread_t value you need to pass to it. --- That seems like an actionable task Created attachment 171387 [details]
fix-kwin-realtime-thread-musl.patch
that patch should work on both glibc and musl A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6107 Git commit 5921be95d3bfcf239436681bc5fe7837c5cee203 by Vlad Zahorodnii. Committed on 16/07/2024 at 12:56. Pushed by vladz into branch 'master'. utils: Fix gaining realtime scheduling with musl sched_setscheduler() is implemented as a stub in musl that does nothing because Linux provides no way to set scheduling parameters per process. Use pthread_setschedparam() to change the scheduling parameters of the threads instead. M +2 -1 src/utils/realtime.cpp https://invent.kde.org/plasma/kwin/-/commit/5921be95d3bfcf239436681bc5fe7837c5cee203 Git commit 2b7882fbbc734101b097b7b7b019197386769eb1 by Vlad Zahorodnii. Committed on 17/07/2024 at 05:29. Pushed by vladz into branch 'Plasma/6.1'. utils: Fix gaining realtime scheduling with musl sched_setscheduler() is implemented as a stub in musl that does nothing because Linux provides no way to set scheduling parameters per process. Use pthread_setschedparam() to change the scheduling parameters of the threads instead. (cherry picked from commit 5921be95d3bfcf239436681bc5fe7837c5cee203) Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> M +2 -1 src/utils/realtime.cpp https://invent.kde.org/plasma/kwin/-/commit/2b7882fbbc734101b097b7b7b019197386769eb1 |