Low CPU frequency all the time

Hi all!
Installed DietPie 7.7 on my old Lenovo S10-3 netbook to use it as a wireguarg VPN. Everything seems to be fine, but I noticed that the CPU is running at a low frequency all the time. Intel Atom N455 can run at 1667 MHz, but the “cpu” command shows ~450Mhz current frequency and 1000/1000 min/max. Even if I set the CPU Governor to “performance” and 1000/1667 (min/max), and run the stress test, it keeps showing ~450Mhz current frequency. Any suggestions on how to fix this?

The CPU governor cannot affect the maximum frequency, but is responsible only for scaling between min and max.

When you say 1000/1000 and 1000/1667, does this mean the default min/max in /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq and /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq and you were able to raise the maximum value above its default? These are the limits for the governor which cannot be lower/higher than what the kernel/firmware allows as absolute range. And by default (when you choose “Disabled” in dietpi-config) those limits should match the absolute range :thinking:.

Furthermore strange that the minimum was 1000 MHz but the current frequency was 450 MHz? That shouldn’t be possible. Please try to disable both frequency limits, switch to schedutil governor and then paste the output of cpu here.

/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq and /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq are set to 1000000, and i cant change it: “[ Error writing lock file ./.scaling_max_freq.swp: Permission denied ]”

Nothing’s changed.

 DietPi CPU Info
 Use dietpi-config to change CPU / performance options
 ─────────────────────────────────────────────────────
 Architecture |     x86_64
 Temperature  |     56'C : 132'F (Running warm, but safe)
 Governor     |     schedutil

                 Current Freq    Min Freq   Max Freq
 CPU0         |      497 MHz      1000 MHz    1000 MHz
 CPU1         |      496 MHz      1000 MHz    1000 MHz

[ INFO ] DietPi-CPU_info | CPU current frequency, may be affected by this script, due to the processing required to run it.

PS: Made another usb drive and ran it on another old laptop with a C2D T7200, and everything seems fine there. Maybe the problem is that my Lenovo runs without battery, some hardware limitation?

Ah is the intel pstate driver used instead of CPUfreq?

cat /sys/devices/system/cpu/intel_pstate/{min,max}_perf_pct
cat /sys/devices/system/cpu/intel_pstate/no_turbo
ls -l /sys/devices/system/cpu/intel_pstate

Nope :cry:
“No such file or directory”

root@DietPi:/sys/devices/system/cpu# ls
cpu0  cpufreq  hotplug   kernel_max  modalias  online    power    smt     vulnerabilities
cpu1  cpuidle  isolated  microcode   offline   possible  present  uevent

Strange, so somehow the CPU frequency is not properly managed by the Linux CPUfreq driver. Can you show:

lsmod
cat /proc/cpuinfo

Yeah, maybe I did something wrong during installation?

root@DietPi:~# lsmod
Module                  Size  Used by
wireguard              90112  0
libchacha20poly1305    16384  1 wireguard
chacha_x86_64          28672  1 libchacha20poly1305
poly1305_x86_64        28672  1 libchacha20poly1305
ip6_udp_tunnel         16384  1 wireguard
udp_tunnel             20480  1 wireguard
libblake2s             16384  1 wireguard
blake2s_x86_64         20480  1 libblake2s
curve25519_x86_64      36864  1 wireguard
libcurve25519_generic    49152  2 curve25519_x86_64,wireguard
libchacha              16384  1 chacha_x86_64
libblake2s_generic     20480  1 blake2s_x86_64
ctr                    16384  3
aes_generic            36864  6
libaes                 16384  1 aes_generic
crypto_simd            16384  0
cryptd                 24576  1 crypto_simd
glue_helper            16384  0
ccm                    20480  9
i915                 2711552  1
ath9k                 139264  0
ath9k_common           20480  1 ath9k
ath9k_hw              487424  2 ath9k_common,ath9k
ath                    36864  3 ath9k_common,ath9k,ath9k_hw
mac80211              983040  1 ath9k
cpufreq_ondemand       16384  0
cpufreq_powersave      20480  0
cpufreq_conservative    16384  0
snd_hda_codec_realtek   155648  1
cpufreq_userspace      20480  2
snd_hda_codec_generic    98304  1 snd_hda_codec_realtek
ledtrig_audio          16384  1 snd_hda_codec_generic
snd_hda_intel          57344  0
snd_intel_dspcfg       28672  1 snd_hda_intel
soundwire_intel        45056  1 snd_intel_dspcfg
soundwire_generic_allocation    16384  1 soundwire_intel
snd_soc_core          315392  1 soundwire_intel
drm_kms_helper        278528  1 i915
cfg80211              970752  4 ath9k_common,ath9k,ath,mac80211
snd_compress           32768  1 snd_soc_core
soundwire_cadence      36864  1 soundwire_intel
uvcvideo              114688  0
snd_hda_codec         172032  3 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec_realtek
videobuf2_vmalloc      20480  1 uvcvideo
cec                    61440  2 drm_kms_helper,i915
videobuf2_memops       20480  1 videobuf2_vmalloc
snd_hda_core          110592  4 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
videobuf2_v4l2         36864  1 uvcvideo
videobuf2_common       65536  2 videobuf2_v4l2,uvcvideo
snd_hwdep              16384  1 snd_hda_codec
drm                   618496  3 drm_kms_helper,i915
soundwire_bus          90112  3 soundwire_intel,soundwire_generic_allocation,soundwire_cadence
videodev              286720  3 videobuf2_v4l2,uvcvideo,videobuf2_common
snd_pcm               135168  6 snd_hda_intel,snd_hda_codec,soundwire_intel,snd_compress,snd_soc_core,snd_hda_core
snd_timer              49152  1 snd_pcm
snd                   110592  9 snd_hda_codec_generic,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm
sg                     36864  0
iTCO_wdt               16384  0
coretemp               20480  0
mc                     61440  4 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common
evdev                  28672  0
joydev                 28672  0
intel_pmc_bxt          16384  1 iTCO_wdt
libarc4                16384  1 mac80211
iTCO_vendor_support    16384  1 iTCO_wdt
soundcore              16384  1 snd
watchdog               28672  1 iTCO_wdt
serio_raw              20480  0
at24                   24576  0
wmi_bmof               16384  0
pcspkr                 16384  0
i2c_algo_bit           16384  1 i915
nft_counter            16384  1
ideapad_laptop         24576  0
sparse_keymap          16384  1 ideapad_laptop
rfkill                 28672  4 ideapad_laptop,cfg80211
nft_chain_nat          16384  4
xt_MASQUERADE          20480  1
ac                     16384  0
acpi_cpufreq           32768  1
nf_nat                 53248  2 nft_chain_nat,xt_MASQUERADE
button                 24576  0
nf_conntrack          176128  2 nf_nat,xt_MASQUERADE
nf_defrag_ipv6         24576  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
xt_comment             16384  1
nft_compat             20480  2
nf_tables             245760  7 nft_compat,nft_counter,nft_chain_nat
libcrc32c              16384  3 nf_conntrack,nf_nat,nf_tables
nfnetlink              16384  2 nft_compat,nf_tables
fuse                  167936  1
configfs               57344  1
ip_tables              32768  0
x_tables               53248  4 nft_compat,xt_comment,ip_tables,xt_MASQUERADE
autofs4                53248  2
ext4                  921600  1
crc16                  16384  1 ext4
mbcache                16384  1 ext4
jbd2                  151552  1 ext4
crc32c_generic         16384  3
sd_mod                 61440  2
t10_pi                 16384  1 sd_mod
crc_t10dif             20480  1 t10_pi
crct10dif_generic      16384  1
crct10dif_common       16384  2 crct10dif_generic,crc_t10dif
ums_realtek            24576  1
uas                    32768  0
usb_storage            81920  2 uas,ums_realtek
ahci                   40960  0
libahci                45056  1 ahci
libata                290816  2 libahci,ahci
uhci_hcd               53248  0
ehci_pci               20480  0
ehci_hcd               98304  1 ehci_pci
scsi_mod              262144  5 sd_mod,usb_storage,uas,libata,sg
psmouse               184320  0
usbcore               323584  7 ehci_pci,usb_storage,uvcvideo,ehci_hcd,uas,ums_realtek,uhci_hcd r8169                 102400  0
i2c_i801               32768  0
i2c_smbus              20480  1 i2c_i801
lpc_ich                28672  0
realtek                24576  1
mdio_devres            16384  1 r8169
libphy                151552  3 r8169,mdio_devres,realtek
usb_common             16384  4 usbcore,uvcvideo,ehci_hcd,uhci_hcd
wmi                    36864  2 wmi_bmof,ideapad_laptop
battery                20480  0
video                  53248  2 ideapad_laptop,i915



root@DietPi:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 28
model name      : Intel(R) Atom(TM) CPU N455   @ 1.66GHz
stepping        : 10
microcode       : 0x107
cpu MHz         : 495.811
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm dtherm bugs            :
bogomips        : 3325.04
clflush size    : 64
cache_alignment : 64
address sizes   : 32 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 28
model name      : Intel(R) Atom(TM) CPU N455   @ 1.66GHz
stepping        : 10
microcode       : 0x107
cpu MHz         : 494.601
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm dtherm bugs            :
bogomips        : 3325.04
clflush size    : 64
cache_alignment : 64
address sizes   : 32 bits physical, 48 bits virtual
power management:

I don’t think that you made something wrong, but that this Atom CPU is not well supported by the current Linux CPUfreq driver/scheduler. Wouldn’t be the first time we see issues with an Atom.

So the CPU scheduler is acpi_cpufreq, which is pretty much the default indeed. Can you try:

modprobe pcc-cpufreq
modprobe -r acpi-cpufreq

:face_with_raised_eyebrow:

modprobe: FATAL: Module acpi_cpufreq is in use.

it looks like I need to disable acpi_cpufreq first?

Try it like that:

modprobe -rf acpi-cpufreq
modprobe pcc-cpufreq

same error

Like I said, I’m using an old laptop and it’s battery free. It seems that the low CPU frequency is a hardware limitation when the laptop can’t charge the battery (my case). Maybe there is a software solution to solve this problem?

I think I’ve found the cause. CPU frequency starts dropping when the temperature rises above 48 degrees, but the fan in the laptop begins to run only after 60 degrees. So I either need to get the fan running before the processor starts to heat up, or disable BD_Prochot.

Ah this makes sense. Does cpu also show a higher maximum frequency before it gets hot?

Yes. Until the processor temperature rises to 47 degrees Celsius, everything works as it should. When the temperature rises above 48, I literally watch the CPU frequency drop to 450.


Update:
pwmconfig: There are no pwm-capable sensor modules installed

So, i tried to boot from ssd with win7 to update the bios, but accidently forgot to change boot order and booted from SD with DietPi. And guess what??? CPU frequency not dropping down any more. To check that is really true, i have installed old 80GB hdd and again booted on to DietPi, and CPU frequency was totally fine.
What was that, weird bug?

Murphy’s law :sunglasses:

Lol, strange indeed. Great that it works now.