pyamsoft / pstate-frequency

Easily control Intel p-state driver on Linux
https://pyamsoft.blogspot.com/
GNU General Public License v2.0
172 stars 19 forks source link

cat: /sys/devices/system/cpu/cpufreq/boost: No such file or directory #30

Closed CarstenGrohmann closed 7 years ago

CarstenGrohmann commented 7 years ago

Hi,

the script throws an error message on a current RHEL7:

Error message

# ./pstate-frequency -G -c
cat: /sys/devices/system/cpu/cpufreq/boost: No such file or directory
./pstate-frequency: line 1090: [: : integer expression expected
pstate-frequency version 3.7.2
    pstate::CPU_DRIVER   -> pcc-cpufreq
    pstate::CPU_GOVERNOR -> performance
    pstate::TURBO        ->  [OFF]
    pstate::CPU_MIN      -> 36% [1200000KHz]
    pstate::CPU_MAX      -> 100% [3300000KHz]

Used kernel

# uname -a
Linux mysrv 3.10.0-514.6.1.el7.x86_64 #1 SMP Sat Dec 10 11:15:38 EST 2016 x86_64 x86_64 x86_64 GNU/Linux

Content of /sys/devices/system/cpu

# ll /sys/devices/system/cpu
total 0
drwxr-xr-x 8 root root    0 Feb 28 14:07 cpu0
drwxr-xr-x 8 root root    0 Feb 28 14:07 cpu1
[...]
drwxr-xr-x 8 root root    0 Feb 28 14:07 cpu8
drwxr-xr-x 8 root root    0 Feb 28 14:07 cpu9
drwxr-xr-x 2 root root    0 Feb 28 14:08 cpuidle
-r--r--r-- 1 root root 4096 Feb 28 14:07 isolated
-r--r--r-- 1 root root 4096 Feb 28 14:08 kernel_max
drwxr-xr-x 2 root root    0 Feb 28 14:08 microcode
-r--r--r-- 1 root root 4096 Feb 28 14:08 modalias
-r--r--r-- 1 root root 4096 Feb 28 14:07 nohz_full
-r--r--r-- 1 root root 4096 Feb 28 14:08 offline
-r--r--r-- 1 root root 4096 Feb 28 14:07 online
-r--r--r-- 1 root root 4096 Feb 28 14:08 possible
drwxr-xr-x 2 root root    0 Feb 28 14:08 power
-r--r--r-- 1 root root 4096 Feb 28 14:08 present
-rw-r--r-- 1 root root 4096 Feb 28 14:07 uevent

It would be really great if you could fix this error.

BTW: What do you think about adding the GitHub URL to the script header?

Regards, Carsten

pyamsoft commented 7 years ago

Thanks for reporting, I'll take a look.

I fear that the kernel you are using was before the boost file was added for acpi-cpufreq.

pyamsoft commented 7 years ago

Please try the latest master branch and let me know if you get the same error.

I have added a patch which makes pstate-frequency log a warning when it cannot write to the boost file, but it should not cause an error.

Unfortunately, the fact that older kernels do not have this file prevents pstate-frequency from accurately reporting the state of Turbo Boost when running the acpi-cpufreq schedulers on these older kernels.

Accurate reporting is possible using msr-tools, but may be out of the scope of this project.

CarstenGrohmann commented 7 years ago

I've tested the current version. The bug is fixed now:

# ./pstate-frequency -G -c
pstate-frequency version 3.7.3
    pstate::CPU_DRIVER   -> pcc-cpufreq
    pstate::CPU_GOVERNOR -> performance
    pstate::TURBO        -> 0 [OFF]
    pstate::CPU_MIN      -> 36% [1200000KHz]
    pstate::CPU_MAX      -> 100% [3300000KHz]

Thank you, Carsten