Cannot save scaling_governor settings

Kernels & Hardware, configuring network, installing services

Cannot save scaling_governor settings

Postby EIKA » 2021-01-09 11:20

Hi all!

Debian 10.7 net install. 32 bit OS. CPU Intel N280 (single core, two threads). Nominal CPS frequency is 1662MHz. BIOS settings are unknown (remote machine with no iLO/KVM).

But CPC is here, because I see these files:

Code: Select all
find / -name scaling_governor
find / -name scaling_max_freq

Current CPU scheme is ondemand. It's confirmed by cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor command. Its output is:

Code: Select all
ondemand
ondemand

But if I change these to performance, new settings applies well:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor


Code: Select all
performance
performance

But once PC is rebooted, they reverts back to ondemand :(

The same issue with:
apt install cpufrequtils
for i in 0 1; do cpufreq-set -c $i -g performance; done


Also tried to set up kernel values via grub:

nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=0 processor.max_cstate=1 pcie_aspm=off idle=poll"
update-grub
sysctemctl reboot


But they are ignored after reboot, and CPU again shows low speeds like 1030-1260MHz :(

dmesg -T | grep intel_idle output is:

Code: Select all
[Sat Jan  9 14:48:34 2021] intel_idle: MWAIT substates: 0x20220
[Sat Jan  9 14:48:34 2021] intel_idle: v0.4.1 model 0x1C
[Sat Jan  9 14:48:34 2021] intel_idle: lapic_timer_reliable_states 0x2

Any ideas guys?
EIKA
 
Posts: 16
Joined: 2021-01-01 15:17

Re: Cannot save scaling_governor settings

Postby Head_on_a_Stick » 2021-01-09 12:00

/sys is a virtual filesystem so any changes will not persist. Add your echo commands to /etc/rc.local to have them run at every boot. And don't disable C-State, Intel almost certainly knows how to handle the processor better than you.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13062
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Cannot save scaling_governor settings

Postby EIKA » 2021-01-09 12:53

Hi!

Thanks for your reply. Does it looks OK?

Image

Plus chmod +x?
EIKA
 
Posts: 16
Joined: 2021-01-01 15:17

Re: Cannot save scaling_governor settings

Postby CwF » 2021-01-09 14:01

You can create add the entry to /stc/sysfs.d/cpupolicy.conf
CwF
 
Posts: 881
Joined: 2018-06-20 15:16

Re: Cannot save scaling_governor settings

Postby EIKA » 2021-01-09 14:35

CwF wrote:You can create add the entry to /stc/sysfs.d/cpupolicy.conf

Thanks.

Is syntax would be the same as shown above? echo performance...
EIKA
 
Posts: 16
Joined: 2021-01-01 15:17

Re: Cannot save scaling_governor settings

Postby CwF » 2021-01-09 15:07

EIKA wrote:Is syntax would be the same as shown above? echo performance...

very good, no it's not, I failed to mention...hold on...checking...
Code: Select all
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = performance
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = performance



...scan dmesg or logs for entries like:
Code: Select all
sysfsutils[1256]: Setting sysfs variables...unknown attribute devices/system/cpu/cpufreq
CwF
 
Posts: 881
Joined: 2018-06-20 15:16

Re: Cannot save scaling_governor settings

Postby Head_on_a_Stick » 2021-01-09 16:53

EIKA wrote:Does it looks OK?

Yes but you don't need "exit 0" at the end.

EIKA wrote:Plus chmod +x?

Yes.

But having said that CwF's method makes more sense (I didn't know about /etc/sysfs.d/ so thanks for that).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13062
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Cannot save scaling_governor settings

Postby EIKA » 2021-01-09 18:46

CwF wrote:very good, no it's not, I failed to mention...hold on...checking...

Code: Select all
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = performance
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = performance

Both directory and file was missed and I created them. Is it OK?

Image

Do I need to set any special rights (bits) for the them?
EIKA
 
Posts: 16
Joined: 2021-01-01 15:17

Re: Cannot save scaling_governor settings

Postby CwF » 2021-01-09 19:36

EIKA wrote:Do I need to set any special rights (bits) for the them?

You needed root to create the directory and file, so no, it's all set, just reboot and check.

Isysfs.d is not created by default, and it is somewhat machine specific. The sysfs enumeration may be different between packages, so if that sysfs directory exist (/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) on your system you should be good. Basically, all options are in that directory can be set if needed. Newer processors have fewer options beyond the governor.
CwF
 
Posts: 881
Joined: 2018-06-20 15:16

Re: Cannot save scaling_governor settings

Postby EIKA » 2021-01-09 19:46

I did this

Image

restated the machine and these instructions was ignored. CPU is still running at 1GHz instaed of 1.66GHz.
EIKA
 
Posts: 16
Joined: 2021-01-01 15:17

Re: Cannot save scaling_governor settings

Postby CwF » 2021-01-09 20:52

ya, I don't know your gigahertz! To check;
Code: Select all
:~$  cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
performance powersave
:~$  cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
powersave
:~$  cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
intel_pstate

and take a look for errors, if the system is paying attention to your added config = there is a status line somewhere. I'm rusty on this and you may need some additional packages. Or fail the method and echo them in...

I don't use this anymore so...but you can also simply pin the cpu to a clock and ignore the governor, just echo to /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq.
CwF
 
Posts: 881
Joined: 2018-06-20 15:16

Re: Cannot save scaling_governor settings

Postby EIKA » 2021-01-10 08:05

This is my output:

Code: Select all
root@HP-T5745-TC:/# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
ondemand performance schedutil
root@HP-T5745-TC:/# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ondemand
root@HP-T5745-TC:/# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
acpi-cpufreq
root@HP-T5745-TC:/#

And CPU is saving power/lowering core speed:

Code: Select all
root@HP-T5745-TC:/# egrep '(MHz)' /proc/cpuinfo
cpu MHz         : 1166.035
cpu MHz         : 1143.262
Last edited by EIKA on 2021-01-10 08:08, edited 1 time in total.
EIKA
 
Posts: 16
Joined: 2021-01-01 15:17

Re: Cannot save scaling_governor settings

Postby EIKA » 2021-01-10 08:07

CwF wrote: just echo to /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq.

As was told by Head_on_a_Stick
sys is a virtual filesystem so any changes will not persist.

But I need to have max performance all the time even after reboot.
EIKA
 
Posts: 16
Joined: 2021-01-01 15:17

Re: Cannot save scaling_governor settings

Postby CwF » 2021-01-10 16:03

Have you installed cpufrequtils ?
That should then read your settings.
CwF
 
Posts: 881
Joined: 2018-06-20 15:16

Re: Cannot save scaling_governor settings

Postby EIKA » 2021-01-10 16:08

CwF wrote:Have you installed cpufrequtils ?
That should then read your settings.

Just did that. What's my next step after that? I am still using cpupolicy.conf.
EIKA
 
Posts: 16
Joined: 2021-01-01 15:17

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable