2

I have Ubuntu 19.04 with all updates installed with Intel i9 9900k processor and Asrock H370M pro4 motherboard, it's updated to the latest bios.

I cannot make Turbo boost work for single thread loads (Which I have plenty of and boost in Ghz would be very helpful) If I run some inherently single thread load (and can confirm that only one core being loaded), for example:

sysbench --threads=1 --time=1000 --test=cpu run

I see all cores jump to 4.7Ghz. I expect the core that is under 100% load should jump to 5.0ghz

I have turbo boost enabled:

$ cat /sys/devices/system/cpu/intel_pstate/no_turbo
0

(if I disable it processor speed won't rise above 3.7)

I've read that sometimes some tools doesn't report accurate frequency and in fact turbo boost may work - I've tried multitude of tools with neither reported any different (all cores maxed at 4.7 doing single thread load).

turbostat for example correctly identifies turboboost parameters:

cpu1: MSR_IA32_POWER_CTL: 0x003c005d (C1E auto-promotion: DISabled)
cpu1: MSR_TURBO_RATIO_LIMIT: 0x2f2f2f3030313232
47 * 100.0 = 4700.0 MHz max turbo 8 active cores
47 * 100.0 = 4700.0 MHz max turbo 7 active cores
47 * 100.0 = 4700.0 MHz max turbo 6 active cores
48 * 100.0 = 4800.0 MHz max turbo 5 active cores
48 * 100.0 = 4800.0 MHz max turbo 4 active cores
49 * 100.0 = 4900.0 MHz max turbo 3 active cores
50 * 100.0 = 5000.0 MHz max turbo 2 active cores
50 * 100.0 = 5000.0 MHz max turbo 1 active cores

Still, under single thread load it also shows that all cores are at 4.7Ghz despite only single one is loaded:

$cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
4815705
4721193
4799105
4772830
4794879
4782198
4891662
4714048
4749921
4737188
4801009
4859085
4734327
4735355
4747906
4826031

There is no setting in bios to make all cores always work at max speed (no core optimization or anything remotely related to cores), I've tried to played with all possible settings with no change.

I've tried to change cpu governor to performance with no effect - only all cores are constantly locked at 4.7 instead of on demand.

What's interesting, if I disable cores with echo 0 | sudo tee /sys/devices/system/cpu/cpu1/online and leave only 2 cores online - they do in fact reach 5.0 Ghz but that's definitely not a sustainable solution.

Please advise what can else be done

Thank you in advance!

2 Answers 2

1

Is your computer running a desktop version of Ubuntu, with all that GUI stuff? The issue is that "idle" on a desktop computer actually isn't and what you are observing in your CPU frequency listings is the result of the other cores waking up to do the other tasks.

My main test computer is an Ubuntu 16.04 server (no GUI) with an older i7-2600K. "idle" is better than for a desktop, but still not great. However, if I disable several services "idle" becomes much better and we start to observe considerable time spent at the maximum single active core CPU frequency when we subsequently apply a single 100% load (12.5% is 1 of 8 CPUs at full load):

cpu5: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled)
cpu5: MSR_TURBO_RATIO_LIMIT: 0x23242526
35 * 100.0 = 3500.0 MHz max turbo 4 active cores
36 * 100.0 = 3600.0 MHz max turbo 3 active cores
37 * 100.0 = 3700.0 MHz max turbo 2 active cores
38 * 100.0 = 3800.0 MHz max turbo 1 active cores

doug@s15:~/temp$ cat set_cpu_turn_off_services
#! /bin/bash
# Turn off some services to try to get "idle" to be more "idle"
sudo systemctl stop mysql.service
sudo systemctl stop apache2.service
sudo systemctl stop nmbd.service
sudo systemctl stop smbd.service
sudo systemctl stop cron.service
sudo systemctl stop winbind.service
sudo systemctl stop apt-daily.timer
sudo systemctl stop libvirtd.service

doug@s15:~/temp$ sudo ./set_cpu_turn_off_services
doug@s15:~/temp$ sudo turbostat --quiet --Summary --show Busy%,Bzy_MHz,PkgTmp,PkgWatt,GFXWatt,IRQ --interval 15
Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt GFXWatt
0.03    1600    686     25      3.79    0.12  <<< Check my idle, before applying load
0.02    1600    401     27      3.78    0.12
0.02    1600    395     25      3.78    0.12
0.02    1600    356     26      3.78    0.12
0.02    1600    395     25      3.78    0.12
10.25   3796    12991   42      19.44   0.12  <<< Apply single 100% load
12.51   3800    15777   44      23.12   0.12  <<< max turbo freq for 1 active core.
12.51   3800    15740   45      23.21   0.12
12.51   3800    15769   47      23.31   0.12
0

To get the most accurate current CPU speed for each core use:

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
1367598
1617138
1425100
1719268
1414236
1545359
1295130
1163015

There are three implied decimal positions so the first core's speed reported as 1367598 is really 1,367.598 MHz. When you use this method you should see the core under load with a a higher frequency than the rest.


TL;DR

I had a glitch for about a year where all processors would run close to max frequency under no load. Then under video stream they would all drop to about 50% frequency and load would be about 20 to 25%. This glitch persisted until last week when I installed kernel 4.14.140. At least it now seems the glitch is gone.

6
  • It's not, I've updated question with this command. Also, turbostat, htop, and multiple other tools I've find on askubuntu.com reports the same frequencies. Sep 5, 2019 at 11:43
  • @HandsomeJack I've updated the answer with a glitch I had for about a year. Sep 5, 2019 at 11:51
  • Thanks for the comment! However it doesn't appear to be the case - I'm using 5.0.0-27 and observing this behavior for couple of months with no change despite of multiple kernel versions change. (although may worth to try 18.04 with an older kernel, perhaps it's a new bug, I'll give it a try and update my question accordingly) Sep 5, 2019 at 13:58
  • The equivalent to 4.14.140 LTS kernel I'm using would probably be 5.2.10 short term kernel release around the same date. but that has newer hardware support. Sep 5, 2019 at 15:07
  • With no load what do your frequencies report? eg something close to 800 MHz? Sep 5, 2019 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.