3

I have a kubuntu 14.04 with the latest HWE kernel (3.16.0-31-generic), and a Xeon 1246v3 processor (which is basically an i7 4770 with ecc support). The processor has base frequency of 3.5 ghz, and max turbo frequency of 3.9 ghz.

I have the following questions:

1) I have intel p-states enabled by default, which is fine, but you know that with p-states you only get two governors: performance, and powersave. How can I manually set the maximum allowed cpu frequency?

2) As stated above, the cpu should be able to run at 3.9 only with one core loaded. With full load on all cores, it should not be able to go over 3.5 ghz. But if I issue the command watch -n 0 "cat /proc/cpuinfo | grep -i mhz" , I see that ALL four cores are constantly at 3.9 ghz, which should be impossible. How's that?

Thanks!

1

3 Answers 3

4

You can set maximum and minimum frequencies by setting /sys/devices/system/cpu/cpu**N**/cpufreq/scaling_min_freq and /sys/devices/system/cpu/cpu**N**/cpufreq/scaling_max_freq

Details are described in this document: https://software.intel.com/sites/default/files/comment/1716807/how-to-change-frequency-on-linux-pub.txt

Edit: You can reach the same using cpufreq-set in cpufrequtils package: https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufreq-set.html

3
  • Useful answer, but look what happens: cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies: No such file or directory. I think this is because i have p-states enabled..
    – MadHatter
    Mar 18, 2015 at 11:32
  • @MadHatter: yes, that seems to be the problem. According to documentation, with P-state there is no way you can control frequency of the processor: kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt (see last but one article)... Mar 18, 2015 at 11:37
  • well, I'll try to disable p-states. Thanks, anyway...
    – MadHatter
    Mar 18, 2015 at 11:50
3

Question 1: How can I manually set the maximum allowed cpu frequency?

For example, to set the maximum frequency to 60 percent of either 3.5 GHz (turbo disabled) or 3.9 GHz (turbo enabled):

echo "60" | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct

Question 2: I see that ALL four cores are constantly at 3.9 ghz, which should [NOT] be impossible. How's that?

They are not all active at the same time. There is only 1 PLL, and all CPUs are always at the same frequency. If you are seeing 3.9GHz, then only 1 CPU was in the C0 state at the time the sample was taken.

2
  • About question 1: I don't use pstates. What file should I address? Thanks.
    – MadHatter
    May 20, 2015 at 20:54
  • I thought the question was for when using the intel_pstate frequency scaling driver. If you are using the acpi-cpufreq frequency scaling driver then use Jakup's answer. May 20, 2015 at 22:51
1

everything mentioned here above works if your kernel has the correct modules loaded :

# CPU frequency control Driver
modprobe acpi_cpufreq
modprobe mperf
# CPU Frequency scaling modules
modprobe cpufreq_conservative
modprobe cpufreq_ondemand
modprobe cpufreq_performance
modprobe cpufreq_powersave
modprobe cpufreq_stats
modprobe cpufreq_userspace
modprobe freq_table

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .