C-states and P-states are very different

C-states are idle states and P-states are operational states. This difference, though obvious once you know, can be initially confusing.

With the exception of C0, where the CPU is active and busy doing something, a C-state is an idle state. Since an idle CPU isn't doing anything (i.e. any useful work), why not shut it down? No one is going to notice since there's no one using it. (Letting a CPU run at full bore when idle is like driving in circles very fast; all you're doing is going nowhere quickly.)

A P-state is an operational state, meaning that the core / processor can be doing useful work in any P-state. The most obvious example is when your laptop is using a low power profile and operating on battery. The OS will lower the C0 operating frequency and voltage, i.e. enter a higher P-state. Reducing the operating frequency reduces the speed at which the processor operates, and so the energy usage per second (i.e. power). Reducing the voltage decreases the leakage current from the CPU's transistors, making the processor more energy efficient resulting in further gains. The net result is a significant reduction in the energy usage per second of the processor. On the flip side, an application will take longer to run. This may or may not be a problem from a power perspective. I'll talk about this issue in some depth in a later blog.

C-states and P-states are also orthogonal. This is a fancy mathematical term meaning that each can vary independently of the other. This doesn't mean that in the higher C-states, the voltage doesn't change. It only means that when you resume C0, you go back to the operating frequency and voltage defined by that P-state.

Next time: C-states, C-states and even more C-states

For more complete information about compiler optimizations, see our Optimization Notice.

13 comments

Top
Jojo H.'s picture

Thanks for your sharing.

I have one questions, what Intel/ other tool I can confirm for P-State?

Can I use BLA both for C-State & P-State checking? thanks.

I'm sort of out of this area now so I'm a little out of date. I'll pass your name to someone who might be able to give you an answer.

Short answer: In the old XP days, there were pdh() commands. These changed into a fancy new and improved broader monitoring system in Vista and Win7. You should be able to Bing it by looking for "Windows performance events monitoring" or some such. I haven't a clue what it is in Win8.

Akshay Venkatesh's picture

Hi Taylor,

Is there an API to toggle these states in applications?

Thanks.

Gregory Junker (Intel)'s picture

"Should'nt the CPU be consuming same power irrespective of whether it is executing an instruction or not ? (since power is depends on frequency and not the execution of instruction)"

Power in a CPU is the same power you may have learned about in high-school or college physics: P = VI. Since the voltage stays the same in a given state (say, P0), the only way for power to increase is for current to increase. And the more switching that is going on (the more functional units on the CPU that are active), the more current is required, so the more power is required. Less switching, less power.

This is why power savings are realized by the CPU disabling various parts of itself when they are not in use. Yes, a higher frequency at a given voltage will require higher current to allow the transistors to operate, but in the typical modern CPU, power is more about which transistors are switching and which are not. ;)

anonymous's picture

Does cpu consume power differently while executing instructions and while being idle ?

Why does a CPU consume different quantities of power at a given frequency X Ghz when

1. it is executing an instruction
2. it is not executing any instruction

Should'nt the CPU be consuming same power irrespective of whether it is executing an instruction or not ? (since power is depends on frequency and not the execution of instruction)

Can a CPU be idle (C1) when it is at 2 Ghz frequency ?

Aubrey W.'s picture

You can find all of Taylor's blog updates by clicking on his name above the article.

anonymous's picture

Interesting. Has there been any updates to this since this was first posted?

anonymous's picture

Hi,
On my idle DL380G6 machine with dual-X5570 processors, I do this:

cat /proc/acpi/processor/CPU?/power | grep active

and I get the following. Any idea why all CPUs are reporting C0? What can they be doing? I have tried setting the machine to "HP Static High Performance Mode" and also to "HP Dynamic Power Savings Mode" but nothing changes. Can you suggest any reason? Thanks.

active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0
active state: C0

anonymous's picture

Hello, Taylor.
I would be interested to know details about what happens during the transition from one P-state to another.

In case you worry about NDA, we can discuss by email - I can provide also more information on why we are interested in this information .
Thank you.

anonymous's picture

Hi Alex,

General mechanisms (what it is) are often publicly available. Specifics (how we got the silly thing to work) are usually not.

Unless your university / company have applicable non-disclosure agreements in place, I can't go into more specifics.

--Taylor

Pages

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.