Showing results for 
Search instead for 
Did you mean: 
New Contributor I

Power and thermal management -- cpu frequency scaling

Hi, I have been trying to dynamically control the CPU frequency at CPL 0. As I searched over the internet, I guess the following processor properties could be used on my platform (i7-6700k, with hyper-therading enabled): speedstep, p_state and c_state. The kernel version is 4.4.0.

It appears to me that both p_state and c_state are controlled by the hardware. Although the system software could hint to the processor, the idle state or the frequency is controlled automatically by the hardware. As I am trying to manipulate the cpu frequency more precisely, I disabled p_state in the GRUB configurations, then I tried to use the legacy acpi_cpufreq driver. After that I was able to set the frequency for each logical core with "cpupower frequency-set -g".

What I found through "i7z" is that the cpu frequency of all logical cores were always almost the same. For example, if at least 1 logical process was set to run in "performance" mode, the frequencies of all logical cores were about 3.4GHZ (maximum frequency without turbo boost); if all logical process were set to run in "powersave" mode, the frequency decreased to about 1GHZ.

My question is that whether there is a way to control the frequency at a physical core (or logical core) granularity? Is it (theoretically) possible for the 2 logical cores sharing a physical core to operate at different frequencies, e.g. 1 at 3.4GHZ and the other 1 at 1 GHZ?

I noticed the thread on a similar issue: In my desktop setting, the hardware seems to set the frequency according to the fastest core. Has anyone tested in a server setting?

Thanks in advance.


0 Kudos
1 Reply
Black Belt

Many of Intel's processors support only a single frequency for all cores in C0, but it is not easy to find definitive information on any particular model.  I would have expected your new processor to support independent frequencies on all cores, but I have not done much work with the "client" processors since Sandy Bridge, so I would just be guessing.

Does your Core i7-6700k support Hardware-coordinated Performance States? (HWP)    If HWP is enabled, the acpi_cpufreq driver won't actually be controlling the frequency.  In recent versions of Linux, the cpupower driver will interact with HWP to set "performance" and "powersave" options, but none of this is documented very clearly.  On my Skylake Xeon systems with HWP enabled, I control the frequency directly with the the IA32_HWP_REQUEST register (MSR 0x774), but I have not tried setting different cores to different frequencies.

On the server processors the Power Control Unit in the uncore may choose to give you a higher frequency than you requested.  When I tested asymmetric operation a few years ago (probably on Haswell EP, but I am not sure), I found the same thing that you are seeing -- if all of the cores are in use, they all get bumped up to the maximum frequency (or close to it).  The uncore performance monitoring guide has a section on the Power Control Unit that tells you how to get more information on why the Power Control Unit decided to override your frequency requests.  Unfortunately the interface is quite complicated and at best it would only tell you why the PCU ignored you, not how to override it.

0 Kudos