LWN: Comments on "The cpuidle subsystem"
http://lwn.net/Articles/384146/
This is a special feed containing comments posted
to the individual LWN article titled "The cpuidle subsystem".
hourly2The cpuidle subsystem
http://lwn.net/Articles/518886/rss
2012-10-08T10:42:35+00:00bandarusivakrishna
<div class="FormattedComment">
Hai All,<br>
<p>
I Need some questions on CPUIDLE SUBSYSTEM<br>
<p>
1) As per Linux Power States Concepts we have C0 to C7 states are their, but in linux kernel we are using only c0 to c3....can any one please clarify what is the reason?<br>
<p>
2) How the processor will move from one state to another state...and once we from one state to another state what about the devices states in kernel...how it control<br>
<p>
We are Doing Power management on ARM Cortex-A9. I am new to power management. can any one help me on CPUIDLE SUBSYSTEM. How it works in Linux kernel governors to Hardware level how the flow is going on...<br>
<p>
Thanks & Regards,<br>
Siva Krishna.<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/407561/rss
2010-09-29T13:17:10+00:00rsv
<div class="FormattedComment">
Sir,<br>
I have some questions on cpu idle<br>
<br>
a) How does the kernel know the cpu is idle.<br>
b) How does it know (predict) that the next activity will most likely happen after some time (say after 50 seconds or so) so that it can switch to the appropriate cpu sleep state.<br>
<p>
Thank you,<br>
rsv<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/395819/rss
2010-07-13T06:38:52+00:00MS_ASU
<div class="FormattedComment">
very nice article. I have two questions. <br>
<p>
What does the number in power field for each C state signify? for C0 its very high on my system. Its 4294967295 (mW). Is it the total power consumed in C0 till now? But seems like this value is not changing.<br>
<p>
The second question is about the C-state transitions. Can a transition occur within the same state? I mean CPU goes into C3 from C3 only. Because the value for C3 usage is very high for my system. (AFAIK the usage number denotes the number of transitions to that state) So seems like the "enter" function is being called from C3 and again the output state is C3.<br>
</div>
S3 is different
http://lwn.net/Articles/385456/rss
2010-04-29T22:29:36+00:00pflugstad
<div class="FormattedComment">
IIRC, S3 is suspend-system-to-RAM, as opposed to the C states, which are just CPU states. <br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/385309/rss
2010-04-29T12:13:31+00:00tialaramex
<div class="FormattedComment">
It was disappointingly difficult to get many server authors to remove such polling behaviour. The response tended to be that (a) they didn't believe it made any difference and (b) this was the only way to measure some arbitrary thing they'd decided their software needed to constantly know about (e.g. free RAM, system load average).<br>
<p>
It appears that after a while everyone just stopped pushing :/<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/385194/rss
2010-04-28T23:33:38+00:00jonabbey
<div class="FormattedComment">
Yah, my nehalem (core i7) Fedora 11 system doesn't report any C-states in powertop, just P-states (reductions in the clockspeed of individual cores).<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/385087/rss
2010-04-28T15:43:51+00:00gartim
<div class="FormattedComment">
Jonathan -- curious what brand/specs are your laptop? -- Gary<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/385062/rss
2010-04-28T14:11:38+00:00nye
<div class="FormattedComment">
Is there anywhere a list of supporting processors? I was hoping that a site like lesswatts.org might have that sort of thing, but I couldn't find that information anywhere short of downloading the datasheets for every individual CPU, and of course there are a near-infinite selection of CPUs on offer nowadays.<br>
<p>
However, if even brand new all-in-one Atom systems don't support this - given that they're targetted specifically at low-power uses - it doesn't seem to be a stretch to conclude that this is something that manufacturers basically don't care about.<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/385043/rss
2010-04-28T12:16:10+00:00hmh
<div class="FormattedComment">
Many desktop CPUs do support it. Your BIOS might not. Your particular CPU might not (or might be buggy and the BIOS went ahead and disabled it for safety). But it is not a rare feature in desktop CPUs anymore.<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/385040/rss
2010-04-28T11:53:44+00:00nye
<div class="FormattedComment">
<font class="QuotedText">>I suspect it needs some word-wrapping: the 'available' has been overwritten by the P-state heading :)</font><br>
<p>
Since it always says that, no matter how wide the terminal in which it's run, you'd think somebody who knows that the message has been truncated would have noticed at some point and fixed it. I just assumed it was a message in some arcane code known to those deeply involved in power usage monitoring :P.<br>
<p>
Anyway it's unfortunate that desktop CPUs don't support this - even the Atom (D510) I bought a month ago only supports C0 and C1, and I don't know if it's possible to tell how long it's spending in what state. It seems you need CPUs designed specifically for battery-powered devices if you want anything more.<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384944/rss
2010-04-27T21:23:30+00:00nix
<div class="FormattedComment">
It's got nothing to do with Intel versus AMD. One of my Nehalem machines reports that message: it's just because C states are turned off in the BIOS.<br>
<p>
I suspect it needs some word-wrapping: the 'available' has been overwritten by the P-state heading :)<br>
<p>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384931/rss
2010-04-27T20:53:48+00:00intgr
<div class="FormattedComment">
<font class="QuotedText">> This was changed (and the message reworded) two years ago</font><br>
Indeed, I pasted that from an older installation. Up-to-date computers give me this ever-confusing message:<br>
"< Detailed C-state information is not P-states (frequencies)"<br>
I guess since this is Intel's software, they don't pay much attention to how it looks like on AMD processors. :)<br>
<p>
<font class="QuotedText">> You can't count C-state counters in software because when the CPU is in</font><br>
<font class="QuotedText">> a C state it is not executing instructions.</font><br>
But you can record timestamps before entering and after leaving the sleep state. Is that too expensive?<br>
<p>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384926/rss
2010-04-27T20:15:38+00:00nix
<div class="FormattedComment">
This was changed (and the message reworded) two years ago in commit 70551c5171abf366b3caa6d22e12892f0da5a95e, after which powertop became capable of reading C-state information exported from sysfs by cpuidle in kernel 2.6.25+ (the data that Jon talks about in this article).<br>
<p>
Prior to that, powertop had to read the data itself by making ACPI calls. I suppose this is less likely to work on non-laptops, even when C-states are available, because it's depending on the BIOS vendor doing the right thing (and we know how often *that* happens).<br>
<p>
So, upgrade powertop and/or upgrade the kernel?<br>
<p>
(You can't count C-state counters in software because when the CPU is in a C state it is not executing instructions. That's the whole point.)<br>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384902/rss
2010-04-27T18:23:21+00:00intgr
<div class="FormattedComment">
I've always wondering why PowerTop reports: "Detailed C-state information is only available on Mobile CPUs (laptops)"<br>
<p>
Why aren't these statistics available on normal CPUs?<br>
And why can't C-state counters be accounted in software?<br>
<p>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384799/rss
2010-04-27T09:37:31+00:00nix
<div class="FormattedComment">
Er, the linked bug is an ACPI bug causing temperature sensing to fail on resume from suspend on some laptops. I doubt it's related to a load-balancing tick on a big beefy quad-core Nehalem server :)<br>
<p>
(did you paste in the wrong link?)<br>
<p>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384787/rss
2010-04-27T06:14:49+00:00koch
The kernel on my dual-core laptop is compiled with NO_HZ, but still keeps itself warm and awake with these "load balancing ticks". There seems to be a <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/526354">bug</a> (with fixes) filed for Ubuntu, describing these symptoms.
The cpuidle subsystem
http://lwn.net/Articles/384778/rss
2010-04-27T04:01:43+00:00svaidy
<div class="FormattedComment">
Good article that describes the subsystem that silently saves power and extends battery life on laptops. This subsystem is also useful on servers that support multiple low power idle states.<br>
<p>
The cpuidle subsystem is being ported to other architectures as well, however as mentioned by our editor the complexity of the subsystem poses some challenges for a clean multi architecture implementation. <br>
<p>
Reference: <br>
[1] cpuidle for POWER (patch v12)<br>
<a href="http://lkml.org/lkml/2010/4/15/190">http://lkml.org/lkml/2010/4/15/190</a><br>
<p>
[2] Discussions and previous patches<br>
<a href="http://lkml.org/lkml/2009/12/2/98">http://lkml.org/lkml/2009/12/2/98</a><br>
<p>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384776/rss
2010-04-27T02:23:11+00:00mcgrof
<div class="FormattedComment">
Great article, if you had a *Like* button I would have just hit it :)<br>
</div>
Power consumption
http://lwn.net/Articles/384771/rss
2010-04-27T00:55:46+00:00xtifr
<div class="FormattedComment">
On my system, I have /sys/devices/system/cpu/cpuidle (not in the cpu0 subdir).<br>
</div>
Power consumption
http://lwn.net/Articles/384772/rss
2010-04-27T00:55:15+00:00arjan
<div class="FormattedComment">
some desktop pc's support C states... but many, especially slightly older ones (1 - 2 years old), do not.<br>
<p>
</div>
Power consumption
http://lwn.net/Articles/384770/rss
2010-04-27T00:45:37+00:00pr1268
<p>I've got S3 enabled in BIOS (I actually rebooted just to look), but I'm curious whether I've got all the proper kernel options set and modules compiled/installed. Sounds like a research project... :-)</p>
<p>Thanks for the replies.</p>
Power consumption
http://lwn.net/Articles/384749/rss
2010-04-26T21:47:20+00:00nix
<div class="FormattedComment">
Perhaps C-states are disabled in your BIOS. (Personally, I've disabled them on my suspended-when-not-in-use desktop simply because when C states are disabled, if the TSC is otherwise stable it can be used as a time source rather than the expensive HPET. On always-on servers and power-important laptops and netbooks, a bit of timekeepoing expense is worth the power saving, so it's best to turn C states on.)<br>
<p>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384748/rss
2010-04-26T21:42:05+00:00nix
<div class="FormattedComment">
Indeed. One of my larger servers, which spends most of its time idle, is disturbingly stating (via powertop) that it spends 77% of its time in C1, only 20% in C3, and is woken up fifty times a second by a mysterious 'load balancing tick'. I wonder what this is? Maybe compiling with NO_HZ would fix it...<br>
<p>
(Still, at least it's running in a low P-state.)<br>
<p>
(A completely idle PostgreSQL 8.4.3 also causes a wakeup every 1/10s, which seems a bit off.)<br>
<p>
</div>
The cpuidle subsystem
http://lwn.net/Articles/384743/rss
2010-04-26T20:59:02+00:00MTecknology
<div class="FormattedComment">
heh... This is an awesome article. Also show you how efficient your system really is (or isn't).<br>
<p>
I just thought I'd show what I found:<br>
michael@panther:/sys/devices/system/cpu/cpu0/cpuidle$ cat */power<br>
4294967295<br>
1000<br>
500<br>
250<br>
michael@panther:/sys/devices/system/cpu/cpu0/cpuidle$ cat */usage<br>
273<br>
306<br>
12054<br>
546476<br>
<p>
I'd say for what I do that's very impressive. :)<br>
</div>
Power consumption
http://lwn.net/Articles/384741/rss
2010-04-26T20:58:59+00:00pr1268
<p>Funny that cpuidle doesn't exist in that directory on my home PC (Slackware 12.2 running vanilla kernel 2.6.31.13). Am I missing something (other than the aforementioned powertop)?</p>
<p>By the way, this is a desktop PC, so all this discussion on my end may be moot (unless I want to save a few pennies on my electric bill). :-)</p>
Power consumption
http://lwn.net/Articles/384721/rss
2010-04-26T18:42:33+00:00corbet
Sorry, I should have mentioned that in the article. Wander into
<p>
<pre>
/sys/devices/system/cpu/cpu0/cpuidle
</pre>
<p>
and you'll find a bunch of files with that information. The <tt>time</tt> and <tt>usage</tt> numbers are there too.
Power consumption
http://lwn.net/Articles/384720/rss
2010-04-26T18:37:53+00:00koch
<div class="FormattedComment">
How did you get the numbers for the power consumption of the different power-states?<br>
<p>
Thank you for an excellent article.<br>
</div>
How do you measure C states?
http://lwn.net/Articles/384718/rss
2010-04-26T17:56:04+00:00corbet
powertop is your friend.
How do you measure C states?
http://lwn.net/Articles/384716/rss
2010-04-26T17:51:41+00:00pr1268
<p>Just curious, how did you measure the C1/C2/C3 stats? Is there a command-line tool for this? Thanks!</p>