LWN: Comments on "The cpuidle subsystem" https://lwn.net/Articles/384146/ This is a special feed containing comments posted to the individual LWN article titled "The cpuidle subsystem". en-us Wed, 01 Oct 2025 18:03:26 +0000 Wed, 01 Oct 2025 18:03:26 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net The cpuidle subsystem https://lwn.net/Articles/518886/ https://lwn.net/Articles/518886/ bandarusivakrishna <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 &amp; Regards,<br> Siva Krishna.<br> </div> Mon, 08 Oct 2012 10:42:35 +0000 The cpuidle subsystem https://lwn.net/Articles/407561/ https://lwn.net/Articles/407561/ rsv <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> Wed, 29 Sep 2010 13:17:10 +0000 The cpuidle subsystem https://lwn.net/Articles/395819/ https://lwn.net/Articles/395819/ MS_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> Tue, 13 Jul 2010 06:38:52 +0000 S3 is different https://lwn.net/Articles/385456/ https://lwn.net/Articles/385456/ pflugstad <div class="FormattedComment"> IIRC, S3 is suspend-system-to-RAM, as opposed to the C states, which are just CPU states. <br> </div> Thu, 29 Apr 2010 22:29:36 +0000 The cpuidle subsystem https://lwn.net/Articles/385309/ https://lwn.net/Articles/385309/ tialaramex <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> Thu, 29 Apr 2010 12:13:31 +0000 The cpuidle subsystem https://lwn.net/Articles/385194/ https://lwn.net/Articles/385194/ jonabbey <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> Wed, 28 Apr 2010 23:33:38 +0000 The cpuidle subsystem https://lwn.net/Articles/385087/ https://lwn.net/Articles/385087/ gartim <div class="FormattedComment"> Jonathan -- curious what brand/specs are your laptop? -- Gary<br> </div> Wed, 28 Apr 2010 15:43:51 +0000 The cpuidle subsystem https://lwn.net/Articles/385062/ https://lwn.net/Articles/385062/ nye <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> Wed, 28 Apr 2010 14:11:38 +0000 The cpuidle subsystem https://lwn.net/Articles/385043/ https://lwn.net/Articles/385043/ hmh <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> Wed, 28 Apr 2010 12:16:10 +0000 The cpuidle subsystem https://lwn.net/Articles/385040/ https://lwn.net/Articles/385040/ nye <div class="FormattedComment"> <font class="QuotedText">&gt;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> Wed, 28 Apr 2010 11:53:44 +0000 The cpuidle subsystem https://lwn.net/Articles/384944/ https://lwn.net/Articles/384944/ nix <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> Tue, 27 Apr 2010 21:23:30 +0000 The cpuidle subsystem https://lwn.net/Articles/384931/ https://lwn.net/Articles/384931/ intgr <div class="FormattedComment"> <font class="QuotedText">&gt; 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> "&lt; 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">&gt; You can't count C-state counters in software because when the CPU is in</font><br> <font class="QuotedText">&gt; 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> Tue, 27 Apr 2010 20:53:48 +0000 The cpuidle subsystem https://lwn.net/Articles/384926/ https://lwn.net/Articles/384926/ nix <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> Tue, 27 Apr 2010 20:15:38 +0000 The cpuidle subsystem https://lwn.net/Articles/384902/ https://lwn.net/Articles/384902/ intgr <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> Tue, 27 Apr 2010 18:23:21 +0000 The cpuidle subsystem https://lwn.net/Articles/384799/ https://lwn.net/Articles/384799/ nix <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> Tue, 27 Apr 2010 09:37:31 +0000 The cpuidle subsystem https://lwn.net/Articles/384787/ https://lwn.net/Articles/384787/ koch 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. Tue, 27 Apr 2010 06:14:49 +0000 The cpuidle subsystem https://lwn.net/Articles/384778/ https://lwn.net/Articles/384778/ svaidy <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> Tue, 27 Apr 2010 04:01:43 +0000 The cpuidle subsystem https://lwn.net/Articles/384776/ https://lwn.net/Articles/384776/ mcgrof <div class="FormattedComment"> Great article, if you had a *Like* button I would have just hit it :)<br> </div> Tue, 27 Apr 2010 02:23:11 +0000 Power consumption https://lwn.net/Articles/384771/ https://lwn.net/Articles/384771/ xtifr <div class="FormattedComment"> On my system, I have /sys/devices/system/cpu/cpuidle (not in the cpu0 subdir).<br> </div> Tue, 27 Apr 2010 00:55:46 +0000 Power consumption https://lwn.net/Articles/384772/ https://lwn.net/Articles/384772/ arjan <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> Tue, 27 Apr 2010 00:55:15 +0000 Power consumption https://lwn.net/Articles/384770/ https://lwn.net/Articles/384770/ pr1268 <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> Tue, 27 Apr 2010 00:45:37 +0000 Power consumption https://lwn.net/Articles/384749/ https://lwn.net/Articles/384749/ nix <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> Mon, 26 Apr 2010 21:47:20 +0000 The cpuidle subsystem https://lwn.net/Articles/384748/ https://lwn.net/Articles/384748/ nix <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> Mon, 26 Apr 2010 21:42:05 +0000 The cpuidle subsystem https://lwn.net/Articles/384743/ https://lwn.net/Articles/384743/ MTecknology <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> Mon, 26 Apr 2010 20:59:02 +0000 Power consumption https://lwn.net/Articles/384741/ https://lwn.net/Articles/384741/ pr1268 <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> Mon, 26 Apr 2010 20:58:59 +0000 Power consumption https://lwn.net/Articles/384721/ https://lwn.net/Articles/384721/ corbet 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. Mon, 26 Apr 2010 18:42:33 +0000 Power consumption https://lwn.net/Articles/384720/ https://lwn.net/Articles/384720/ koch <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> Mon, 26 Apr 2010 18:37:53 +0000 How do you measure C states? https://lwn.net/Articles/384718/ https://lwn.net/Articles/384718/ corbet powertop is your friend. Mon, 26 Apr 2010 17:56:04 +0000 How do you measure C states? https://lwn.net/Articles/384716/ https://lwn.net/Articles/384716/ pr1268 <p>Just curious, how did you measure the C1/C2/C3 stats? Is there a command-line tool for this? Thanks!</p> Mon, 26 Apr 2010 17:51:41 +0000