I have a new intel i7-9700k running in ubuntu 20.04. This processor should clock at base frequency 3.6 GHz with maximum frequency 4.9 GHz in overclocking.
I did an expensive computation today and took a look at the clock frequencies with
watch -n.1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""
and the cpu kernels clocked at ~4.5 GHz. How can this be? I didn't change the BIOS settings? The temperatures where in the normal range according to lm-sensors (below 80 'C mostly). By demand :
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
returns
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
and
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
returns
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave
when busy
When you ran your "expensive computation" There are several reasons why your CPU's might not get to 4.9 GHz, but rather only get to ~4.5 Ghz. One likely reason, particularly if your application is multi-threaded is the typical max frequency reduction as a function of how many cores are active. Example (i7-2600K), excerpt from turbostat:Typically is is highly unusual to see this (i5-9600K, but this is not the default for the processor, I did it in BIOS):
Other reasons include your power bias settings, I/O waits, power or thermal throttling (you mentioned thermal is not the issue, but just saying). If you want the most you can get use performance governor instead of the powersave governor. While many recommend higher level tools, I use primitives:
when idle
When one samples the CPUs at such a high rate, 10 times per second, often the command itself has an effect on the system resulting in a bias in what is observed. Keep in mind that idle CPUs can go into very deep idle states for several seconds at a time, and wakeing them at a high rate just to sample the frequency is not a good idea, yet extremely common among users. If you want to know what is going on with your system, then I would suggest tubostat for two reasons: It is a really good tool; It is also the preferred tool for upstream escalations. But please sample slowly. Example (mostly, I find summary information good enough, but you can drill down into a lot of information. I left the HWP related lines from the initial spew of information):
Now, just because in your case you are seeing much higher CPU frequencies, it doesn't mean your power consumption is much, if any, higher. If the frequency is higher the CPU also finishes its work faster, and it goes back to sleep sooner and for longer. Example:
I read your question that you are surprised to see such high frequency values. The selection of core speeds is not simple. You can get more details by typing the command
cpufreq-info
. It should show you undercurrent policy
that your governor can select between800 MHz and 4.90 GHz
or similar. (My CPU is a i9-9900K and shows between800 MHz and 5.00 GHz
.)If you really want to limit the frequency further, you can use
cpufreq-set
.