SCHED_ISO is not supported by upstream kernels, so don't try to use this by
default since for most users it will result in an error log that trying to
set the scheduling policy fails.
Without extra system configuration, we will also not have permission to renice
processes by default, so out of the box doing this will fail as well.
Users that wish to use these features can enable them from the config once
they have configured their system appropriately.
This should remove a point of failure currently where users fail to set LD_PRELOAD correctly, or the path is wrong somehow.
FWIW: The old method still works, and I've noted that in the README.
This adds 10-gamemode.conf as a limits.d configuration file and with-pam-group meson option to allow renicing as an unpriviledged user being part of the specified group.
Signed-off-by: Térence Clastres <t.clastres@gmail.com>
Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit allows changing the io priority of the client to a value
specified in the configuration file. That can possibly reduce lags or
latency when a game has to load assets on demand and you have background
IO activity running (or other concurrent IO).
Signed-off-by: Kai Krakow <kai@kaishome.de>
Warn the user about adjusting `SCHED_ISO` to too high CPU usage values
as it may render the OS unresponsive.
Signed-off-by: Kai Krakow <kai@kaishome.de>
Depending on the local system architecture and the game architecture,
changes to the scheduling may result in priority inversion which has
counter-intuitive effects on performance. Let's document these to give
the user a chance to detect and fix this problem.
Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit adds configuration support for the renice value and amends
documentation and examples. This commit by itself does nothing, the
following commit is needed to actually apply the new settings.
Signed-off-by: Kai Krakow <kai@kaishome.de>
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>
gamemoded will now load and merge settings from the following locations - arrays will merge and single settings will overwrite.
1. /usr/share/gamemode/
2. /etc/
3. $XDG_CONFIG_HOME or $HOME/.config/
4. $PWD