Image of Modern Operating Systems (3rd Edition)
Image of Android Wireless Application Development
Image of RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)
Image of XSLT 2.0 and XPath 2.0 Programmer's Reference (Programmer to Programmer)

Intel Processor Power Management

Modern Intel processor power management is based on a combination of two techniques: changing the CPU frequency (P-states) and using idling power states (C-states). A third technique, used on older processors but rarely on modern processors, is throttling of the CPU (T-states).

P-states are voltage-frequency pairs that set the speed and power consumption of an Intel processor. When the operating voltage of the processor is lower, so is the power consumption.

C-states are idle power saving states, in contrast to P-states, which are execution power saving states. During a P-state, the processor is still executing instructions, whereas during a C-state (other than C0), the processor is idle, meaning that nothing is executing. Thus C-states are idle states and P-states are operational states. C-states and P-states are orthogonal, i.e. one can vary without affecting the other. C-states have been available for processors targeted at the mobile market for many years but have been only available for the server processors since Nehalem.

In the C0 state, a processor executes instructions. A processor running in any other C-state is somewhat idle. The higher the C-state number, the deeper the CPU sleep mode and the more power saved. The downside to C-States is the latency when reverting to C0. Some C-States have submodes with different power saving latency levels. C1 is always available but which other C-states and submodes are supported is processor-specific.

If you want the absolute minimum latency, set the kernel parameter idle to poll. This keeps the processor(s) at C0 even when idle. Note that keeping processors at C0 can interfere with hyperthreading, i.e. logical cores.

From the the current Linux Kernel Parameters document:

idle=		[X86]
			Format: idle=poll, idle=halt, idle=nomwait
			Poll forces a polling idle loop that can slightly
			improve the performance of waking up a idle CPU, but
			will use a lot of power and make the system run hot.
			Not recommended.
			idle=halt: Halt is forced to be used for CPU idle.
			In such case C2/C3 won't be used again.
			idle=nomwait: Disable mwait for CPU C-states

The higher the P-state, the lower the frequency and voltage at which a processor runs. Once again, the number of P-states is again processor-specific and implementations differ across the various processor families. However, P0 is always the highest-performance state. Higher P-state numbers represent slower processor speeds and lower power consumption. By the way, P-state technology is known as SpeedStep in Intel processors.

Linux supports a CPUfreq subsystem which can be used to modify P-States. If it is enabled on a particular Linux distribution, you will find the relevant files under /sys/devices/system/cpu/. There will be a separate subdirectory for each processor with a cpufreq subdirectory in each processor directory, holding a number of files that define the parameters for CPUfreq.

Finally, a useful tool is cpufreq-info which can be used to retrieve cpufreq-related kernel information.

Comments are closed.