1

My CPU frequency is stuck around the minimum 800 MHz on my Dell Precision 5520. I've exhausted the solutions out there.

Background

My problem is quite similar to this question, but just that my adapter and battery seem to work fine (battery lasts ~8 hours with light usage).

Although I do have a bad adapter I use at work. I realize the battery drains slowly while it's plugged in. Perhaps this someone caused the issue, but at home my adapter is fine.

The output of lscpu, cpufreq-info and i7z were all showing frequency of ~800Mhz whether on AC power or on battery (so seems different than this bug), even when under full load from running stress -c 8.

I ensured the scaling governor was "performance":

~ $ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance
performance
performance
performance
performance
performance
performance
performance

Disabling intel_pstate

Then I disabled intel_pstate reverting to acpi-cpufreq (by editing grub as shown here).

Now, the tools lscpu and cpufreq-info show the frequency is at max, but it's not (see Doug Smythies' comment on the above bug report explaining why those are unreliable). The CPU frequency is correctly shown to still be at minimum by i7z and turbostat.

~ $ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 158
Model name:            Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Stepping:              9
CPU MHz:               2801.000
CPU max MHz:           2801.0000
CPU min MHz:           800.0000
BogoMIPS:              5807.63
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb invpcid_single intel_pt ssbd ibrs ibpb stibp kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp flush_l1d

(on intel_pstate the CPU MHz was ~799)

But looking at the i7z output, it shows: Real Current Frequency 797.92 MHz.

BIOS Problem?

In this answer, the "OS had probably no control over" the frequency and indeed, it seems none of the solutions work. My BIOS shows the frequency at minimum even before Ubuntu starts. Oh also, I'm dual-booted and Windows is really laggy too.

enter image description here

BTW, The BIOS also says my battery health is "Excellent", the charge is at 100% and the adapter is supplying 130W. I also updated my BIOS to the most recent version, 1.12.1 (following this).


EDIT: Requested Extra Information

~ $ sudo lshw -c processor
[sudo] password for garrett: 
  *-cpu                   
       description: CPU
       product: Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
       vendor: Intel Corp.
       physical id: 4c
       bus info: cpu@0
       version: Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
       serial: To Be Filled By O.E.M.
       slot: U3E1
       size: 2801MHz
       capacity: 2900MHz
       width: 64 bits
       clock: 100MHz
       capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb invpcid_single intel_pt ssbd ibrs ibpb stibp kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp flush_l1d cpufreq
       configuration: cores=4 enabledcores=4 threads=8

And kernel version:

~ $ uname -a
Linux ubuntu-laptop 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Garrett
  • 720
  • 3
  • 13
  • 30
  • What is your PC model? – mja Nov 13 '18 at 12:21
  • Also, in your lscpu output, the current CPU frequency is 2801.000MHz. – mja Nov 13 '18 at 12:22
  • what is output of sudo lshw -c processor? – mja Nov 13 '18 at 12:26
  • what kernel version? uname -a. Your lscpu is showing what the driver thinks the CPU frequency should be, not what it actually is, and this has been changed in more recent kernels. – Doug Smythies Nov 13 '18 at 15:40
  • @MarkJ.Adams, it's a "Dell Precision 5520". That's what you mean by "PC model", right? And indeed, lscpu is unreliable, while i7z and turbostat are reliable for CPU frequency (question updated to reflect that). I've added the requested output. – Garrett Nov 13 '18 at 20:13
  • @DougSmythies, I'm on 4.4.0-138-generic (which I've updated in question). – Garrett Nov 13 '18 at 20:14
  • It seems that in some situations (i.e. lscpu) current kernels using the acpi-cpufreq CPU frequency scaling driver still show what it thinks the CPU should be rather than what it actually is. Very demented. Are you checking while certain your system is under load? Please know, that even in performance mode, the CPU itself will back off the frequency under very light load conditions. – Doug Smythies Nov 14 '18 at 00:37
  • @DougSmythies, thanks, yes it was under max load with stress -c 8 (updating question to reflect that). – Garrett Nov 14 '18 at 02:09

1 Answers1

1

I found the solution finally from this Reddit post. It seems it is not Ubuntu as suspected but some bug in Dell BIOS where it permanently puts the computer in some kind of safe mode if you use a bad adapter. Using a good adapter won't turn off this safe mode thing on its own.

So, there 2 solutions proposed here (after you get a good adapter):

  1. open the computer up and disconnect the battery for 10-15s; or
  2. run the battery to empty

I took the second approach since I'm still waiting on my Torx screwdriver set to arrive. I ran the battery empty, then kept turning the computer on until the power button LED wouldn't come on anymore.

Doing sudo i7z (also tested sudo turbostat) show it's fixed: Real Current Freqency 3697.44 MHz.

My BIOS also now shows the CPU frequency not stuck at minimum:

enter image description here

BTW, I also switched back to intel_pstate and it's still working well, so had nothing to do with that after all.

Garrett
  • 720
  • 3
  • 13
  • 30