gamemode icon indicating copy to clipboard operation
gamemode copied to clipboard

Feature Request: renice and ionice other applications to lowest priority

Open emansom opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. GameMode can be configured to renice processes and this works accordingly.

However, other processes like Firefox have similar implementations, often running media processes/threads at higher process priority.

In some scenarios this leads to extra stutter, when e.g. a JavaScript heavy and media heavy website (e.g. YouTube) is playing within Firefox in the background on a low-end (e.g. laptop) processor.

Describe the solution you'd like GameMode to implement a whitelist of processes it scans that will periodically be reniced to a default of 0.

This ensures the game processes always has the highest CPU allocation.

emansom avatar Jan 10 '23 19:01 emansom

Current workaround:

Define the following in gamemode.ini

[custom]
start=/home/ewout/.local/bin/gamemode-lowprio-apps

~/.local/bin/gamemode-lowprio-apps

#!/bin/sh
apps_to_low_prio=('firefox' 'telegram-desktop' 'qbittorrent')

for app in $apps_to_low_prio; do
  for pid in $(pidof $app); do
    renice -n 0 -p $pid;
    ionice -c 3 -p $pid;
  done;
done

emansom avatar Jan 11 '23 00:01 emansom