|
@@ -67,7 +67,9 @@ void game_mode_apply_renice(const GameModeContext *self, const pid_t client)
|
|
|
* read configuration "renice" (1..20)
|
|
|
*/
|
|
|
long int renice = config_get_renice_value(config);
|
|
|
- if ((renice < 1) || (renice > 20)) {
|
|
|
+ if (renice == 0) {
|
|
|
+ return;
|
|
|
+ } else if ((renice < 1) || (renice > 20)) {
|
|
|
LOG_ONCE(ERROR, "Configured renice value '%ld' is invalid, will not renice.\n", renice);
|
|
|
return;
|
|
|
} else {
|
|
@@ -105,12 +107,13 @@ void game_mode_apply_scheduling(const GameModeContext *self, const pid_t client)
|
|
|
* priority inversion problems with the graphics driver thus running
|
|
|
* slower as a result, so enable only with more than 3 cores.
|
|
|
*/
|
|
|
- bool enable_softrealtime = (strcmp(softrealtime, "on") == 0) || (get_nprocs() > 3);
|
|
|
+ bool enable_softrealtime = (strcmp(softrealtime, "on") == 0) ||
|
|
|
+ ((strcmp(softrealtime, "auto") == 0) && (get_nprocs() > 3));
|
|
|
|
|
|
/*
|
|
|
* Actually apply the scheduler policy if not explicitly turned off
|
|
|
*/
|
|
|
- if (!(strcmp(softrealtime, "off") == 0) && (enable_softrealtime)) {
|
|
|
+ if (enable_softrealtime) {
|
|
|
const struct sched_param p = { .sched_priority = 0 };
|
|
|
if (sched_setscheduler(client, SCHED_ISO | SCHED_RESET_ON_FORK, &p)) {
|
|
|
const char *hint = "";
|
|
@@ -139,9 +142,5 @@ void game_mode_apply_scheduling(const GameModeContext *self, const pid_t client)
|
|
|
strerror(errno),
|
|
|
hint);
|
|
|
}
|
|
|
- } else {
|
|
|
- LOG_ERROR("Skipped setting client [%d] into SCHED_ISO mode: softrealtime setting is '%s'\n",
|
|
|
- client,
|
|
|
- softrealtime);
|
|
|
}
|
|
|
}
|