CPU Idle States

On this blog post, I’d like to talk about some of what I’ve learned so as to properly understand the problem I’m addressing in the Full Dynticks implementation in the Linux kernel. I spoke about this in my previous blog post and here I’ll just give a summary :

The idea is to affine unpinned timers to non nohz_full CPU’s ( adaptive CPUs ) so that they are undisturbed by repeated preempting of tasks.

Now, each CPU in order to save energy can be made to go into low power modes or C-States.The basic idea of these modes is to cut the clock signal (or interrupts) and power from idle units inside the CPU. The more units you stop (by cutting the clock), reduce the voltage or even completely shut down, more energy you save. The downside is that you’d need more time for your CPU to wake up, the deeper its state of sleep is!

Consider this:
|                 |
| ——  ——  |
|| O  O || O  O | |
| ——  ——  |

The big box is the package, the two smaller boxes are the cores – Core 0
and Core 1, while the circles are the threads.

On my system (Intel® Core™ i7-5500U CPU @ 2.40GHz × 4) :
Package level has 4 idle states : C2,C3,C6,C7
Core level has  3 idle states : C3,C6,C7
Thread level has 6 idle staes : C0,POLL,C1E,C3, C6, C7

Let’s discuss the CPU idle states now:


A busy CPU is in an active or C0 state. Note that there are also P-states which are execution power saving states, but we’ll not talk about them here.


The first idle state is C1 or HLT (“Halt”) state. All x86 CPU’s have an instruction called “HLT” where it becomes idle or doesn’t run anything till it receives a hardware interrupt. This is the first power saving mode introduced where the internal clock signal is stopped (keeping of course a mode for emergency signals intact).


POLL isn’t a real idle state, in that it does not save  any  power.  Instead, a busy-loop  is executed doing nothing for a short period of time. This state is used if the  kernel  knows  that  work  has  to  be processed  very  soon  and  entering  any  real hardware idle state may        result in a slight performance penalty.

C3On C1 two internal CPU units are kept running: the bus interface unit and the APIC, Advanced Programmable Interface Controller. These units are kept running so the CPU can deal with important requests coming from the CPU external bus and can handle interruptions.

Sleep (C3), cuts the internal clock signals from the CPU, including the clocks from the bus interface unit and from the APIC. This means that when the CPU is in the Sleep mode. now it can’t answer to important requests coming from the CPU external bus nor interruptions.

You can observe the idle stats on your system using Powertop:

sudo apt-get install powertop

Run it with

sudo powertop

Switch to the idle stats tab!


4 thoughts on “CPU Idle States

  1. In our context the Package idle states which are idle power conservation states for the entire package, meaning all the cores and supporting circuitry on the silicon.
    In addition to CPU idle states there is also some package circuitry which can be turned off to conserve more power! And yes, for say PC-3 state, all cores must also be in a C3 or deeper idle state 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s