Login | Register

Feature request: CPU C-states

User feature requests
Planned features for Core Temp
  • Author
    Message

Feature request: CPU C-states

Postby koitsu » Fri Apr 29, 2011 10:23 am

Something I've wanted for a very, very long time from Core Temp was the ability for it to show you processor C-states (both what's currently in use and what C-state capabilities each core has). I'm not talking about system sleep states, I'm talking about processor C-states:

http://en.wikipedia.org/wiki/Advanced_C ... sor_states

At this time, the only utility I know which provides this is RMClock, which has gone into remission and is generally an "ehhh" program anyway. Other tools like ThrottleStop don't provide this either. Remember, I'm not interested in adjusting C-state capability or what's enabled/disabled, I just want to know what's available and what the current state is. You can adjust C-state information per-core, but this isn't ideal (it's best to set it globally), though showing it for each core would probably be wisest.

Since this is a Win32 application, this may be of great help to the author since it discusses the ACPI-related Win32 API calls which are covered under the Power Management API (I used this myself to adjust power profiles on Windows via a command-line app I wrote, until someone told me about powercfg.exe). Below are highly relevant docs, and writing the code should not be difficult:

http://download.microsoft.com/download/ ... ontrol.doc

http://msdn.microsoft.com/en-us/library/bb968807

I'm quite familiar with configuration of FreeBSD and achieving use of both EIST/EST clock frequency throttling as well as making use of C-states, but I've always been saddened by the fact that Core Temp doesn't show me C-state info. :-( Would love for this to work itself in there...

Thanks!
User avatar
koitsu
Registered User
Registered User
 
Posts: 3
Joined: Fri Apr 29, 2011 10:06 am
Location: Mountain View, CA, USA

Re: Feature request: CPU C-states

Postby The Coolest » Sat Apr 30, 2011 9:18 am

Very early versions of Core Temp did implement current C-state.
The problem is that your CPU must be in C0 to execute instructions, and therefore the program has always reported C0.
I may look into listing the highest C-state or something, but displaying the current one is problematic.
Member of our O/C Folding @ Home team
"<The_Coolest> you can't unwaste wasted CPU cycles" - Start FOLDing now!
Main rig:
Core i7 2600K 3.4GHz @ 4.5GHz (Scythe Mugen2) / Mobo: Biostar TP67XE / SSD: Crucial M4 128GB (+ HDDs) / GPU: HD5450 / Mem: 4x4GB DDR3-1600 G.Skill 4GBXL RipJaws X - 16GB total / PSU: Seasonic S12II 620W.
Secondary rig:
Core i3 540 3.06GHz @ Stock / Mobo: MSI H55M-ED55 / GPU: Integrated / Mem: 2x2GB DDR3-1600 G.Skill 4GBRL RipJaws - 4GB total / PSU: FSP ATX350-PNR 350W.

Core Temp - Accurate temperature monitor for Intel's Core/Core 2 and AMD64 processors
User avatar
The Coolest
Site Admin
Site Admin
 
Posts: 2961
Joined: Tue Feb 18, 2003 7:48 pm
Location: Tel Aviv, Israel

Re: Feature request: CPU C-states

Postby koitsu » Sun May 01, 2011 4:09 am

Yes you're right, I hadn't really thought about that :-). Here's how things are implemented on FreeBSD, which might help give you some ideas:

FreeBSD will show you all of the CPU C-states that are supported via the dev.cpu.X.cx_supported sysctl variables (where "X" represents each CPU core). The amount of time each C-state is in use is also tracked via the dev.cpu.X.cx_usage variables. The hw.acpi.cpu.cx_lowest sysctl defines what the lowest C-state is that the system will permit the processor to go into (handled via ACPI hints of course); setting this value trickles down into the dev.cpu.X.cx_lowest variables (so it lets you effectively set all the dev.cpu.X.cx_lowest variables at once).

For example, here are some sysctls on a Core 2 Duo E8400 system:

Code: Select all
hw.acpi.cpu.cx_lowest: C2
dev.cpu.0.cx_supported: C1/0 C2/85
dev.cpu.0.cx_lowest: C2
dev.cpu.0.cx_usage: 72.34% 27.65% last 94us
dev.cpu.1.cx_supported: C1/0 C2/85
dev.cpu.1.cx_lowest: C2
dev.cpu.1.cx_usage: 71.49% 28.50% last 84us


Official documentation:

Code: Select all
     hw.acpi.cpu.cx_lowest
             Lowest Cx state to use for idling the CPU.  A scheduling algo-
             rithm will select states between C1 and this setting as system
             load dictates.  To enable ACPI CPU idling control,
             machdep.cpu_idle_hlt must be set to 1.


Code: Select all
     hw.acpi.cpu.cx_supported
             List of supported CPU idle states and their transition latency in
             microseconds.  Each state has a type (e.g., C2).  C1 is equiva-
             lent to the ia32 HLT instruction, C2 provides a deeper sleep with
             the same semantics, and C3 provides the deepest sleep but addi-
             tionally requires bus mastering to be disabled.  States greater
             than C3 provide even more power savings with the same semantics
             as the C3 state.  Deeper sleeps provide more power savings but
             increased transition latency when an interrupt occurs.


Code: Select all
     hw.acpi.cpu.cx_usage
             Debugging information listing the percent of total usage for each
             sleep state.  The values are reset when hw.acpi.cpu.cx_lowest is
             modified.


EDIT: I hope this helps give you some ideas or some degree of assistance. I realised that Core Temp effectively can't do the C-state usage tracking (that should ultimately be done by the ACPI layer in WIndows), so, at least printing the C-states which are supported would be totally awesome.
User avatar
koitsu
Registered User
Registered User
 
Posts: 3
Joined: Fri Apr 29, 2011 10:06 am
Location: Mountain View, CA, USA

Re: Feature request: CPU C-states

Postby The Coolest » Sun May 01, 2011 8:15 am

I'll consider adding that to the " System Information " portion of the program, since available C-states is not something that interests most users, and can even confuse some of the novice users.
Member of our O/C Folding @ Home team
"<The_Coolest> you can't unwaste wasted CPU cycles" - Start FOLDing now!
Main rig:
Core i7 2600K 3.4GHz @ 4.5GHz (Scythe Mugen2) / Mobo: Biostar TP67XE / SSD: Crucial M4 128GB (+ HDDs) / GPU: HD5450 / Mem: 4x4GB DDR3-1600 G.Skill 4GBXL RipJaws X - 16GB total / PSU: Seasonic S12II 620W.
Secondary rig:
Core i3 540 3.06GHz @ Stock / Mobo: MSI H55M-ED55 / GPU: Integrated / Mem: 2x2GB DDR3-1600 G.Skill 4GBRL RipJaws - 4GB total / PSU: FSP ATX350-PNR 350W.

Core Temp - Accurate temperature monitor for Intel's Core/Core 2 and AMD64 processors
User avatar
The Coolest
Site Admin
Site Admin
 
Posts: 2961
Joined: Tue Feb 18, 2003 7:48 pm
Location: Tel Aviv, Israel

Re: Feature request: CPU C-states

Postby koitsu » Sun May 01, 2011 6:47 pm

Understood, and completely acceptable. And I absolutely understand how it could confuse general users ("sleep state?!?! So when I shut my laptop off, does this affect hibernate?!?!" *sigh*) :-)

Thank you!
User avatar
koitsu
Registered User
Registered User
 
Posts: 3
Joined: Fri Apr 29, 2011 10:06 am
Location: Mountain View, CA, USA

Return to Development

Who is online

Users browsing this forum: Bing [Bot] and 2 guests