mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 23:57:22 +02:00

Kernels that support SCHED_ISO scheduling policy can give processes soft real time support. This improves latency without compromising system stability. See https://lwn.net/Articles/720227/. This commit adds support for setting this policy with a safe fall back if kernel support is lacking by just ignoring the error condition. Additionally, it also tries to raise the nice priority of the game to -4 to give it a slight IO and CPU priority over other background processes. This needs PAM adjustments to allow users raising priority to certain levels. If it doesn't work, the fall back strategy is also ignoring the error condition. See /etc/security/limits.conf. Kernels that currently support SCHED_ISO include kernels with Con Kolivas MuQSS patchset (likely the CK patchset). This patchset is generally recommended for desktop machines but usually not found in standard distribution kernels due to lack of widespread stability tests. Signed-off-by: Kai Krakow <kai@kaishome.de>