FeralInteractive / gamemode

Optimise Linux system performance on demand
BSD 3-Clause "New" or "Revised" License
4.67k stars 184 forks source link

gamemodelist fails trying to open file /proc/*/maps for process systemd --user #456

Closed FLAGEL closed 5 months ago

FLAGEL commented 8 months ago

Describe the bug gamemodelist fails trying to open file /proc/*/maps for process systemd --user. Excluding relevant path in the gamemodelist-script will alleviate the issue. Maybe awk can be forced to ignore permission faults?

To Reproduce

[user@host ~]$ gamemoderun vkcube > /dev/null 2>&1 &
[1] 8815
[user@host ~]$ gamemodelist 
awk: fatal: cannot open file `/proc/813/maps' for reading: Permission denied
[user@host ~]$ ps -C -p 813
    PID TTY      STAT   TIME COMMAND
    813 ?        Ss     0:00 /usr/lib/systemd/systemd --user
[user@host ~]$ gamemoded -s
gamemode is active

Expected behavior

[user@host ~]$ gamemoderun vkcube > /dev/null 2>&1 &
[1] 9118
[user@host ~]$ find /proc -maxdepth 2 -type f -user user -readable -name maps ! -path '*813*' -exec   awk -- '$0 ~ /libgamemodeauto\.so\.0/ {pid=FILENAME; gsub("[^0-9]", "", pid); print pid;nextfile}' {} +   | xargs | xargs -I{} -- ps -o pid,ppid,user,ni,psr,comm --pid '{}'
    PID    PPID USER      NI PSR COMMAND
   9118    1174 user      -5   5 vkcube
[user@host ~]$ gamemoded -s
gamemode is active

System Info (please complete the following information): [1] Linux host 6.6.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 21 Dec 2023 19:01:01 +0000 x86_64 GNU/Linux [2] gamemode 1.8.1-1, systemd 255.2-1