Feature request: CPU C-states

User feature requests
Planned features for Core Temp
Post Reply
User avatar
koitsu
Registered User
Registered User
Posts: 3
Joined: Fri Apr 29, 2011 10:06 am
Location: A world gone mad

Feature request: CPU C-states

Post by koitsu »

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
The Coolest
Site Admin
Site Admin
Posts: 3379
Joined: Tue Feb 18, 2003 7:48 pm
Location: Tel Aviv, Israel
Contact:

Re: Feature request: CPU C-states

Post by The Coolest »

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.
Main rig:
AMD Ryzen 9 5950X (True Spirit 140 Direct) / Mobo: Asrock Fatal1ty X470 / EVO 970 500GB + WD Blue 250GB + HDD / GPU: Dell RX 570 4GB / Mem: 2x16GB DDR4-3200 G.Skill 32GTZKW TridentZ - 32GB total / PSU: Seasonic Prime Ultra Gold 650W
NAS:
Core i7 2600K 3.4GHz @ 4.3GHz (Scythe Mugen2) / Mobo: Biostar TP67XE / 2x Inland Pro 120GB + HDDs / GPU: ATi Mach64 VT2 / Mem: 4x4GB DDR3-1600 G.Skill 8GBXL RipJawsX - 16GB total / PSU: Seasonic S12II 620W.
Secondary rigs:
Core i3 7130U / MiniPC / SanDisk SDSSDP-128G / GPU: Intel HD 620 / Mem: 1x8GB DDR3L-1600
Xeon X3430 2.40GHz @ 3.06GHz or Core i3 540 3.06GHz @ 4.0GHz (Freezer 7 Pro) / Mobo: MSI H55M-ED55 / PNY CS1111 240GB / GPU: ATI FirePro V3800 / Mem: 4x2GB DDR3-1600 G.Skill 4GBRL RipJaws - 8GB total / PSU: Seasonic S12II 620W
AMD Phenom II X4 B93 / Mobo: ASUS M2A-VM / GPU: ATI Radeon Xpress X1250 / Crucial M4 120GB / Mem: 2x2GB DDR2-800 - 4GB total / PSU: Antec 380W.

Core Temp - Accurate temperature monitor for Intel's Core/Core 2 and AMD64 processors

User avatar
koitsu
Registered User
Registered User
Posts: 3
Joined: Fri Apr 29, 2011 10:06 am
Location: A world gone mad

Re: Feature request: CPU C-states

Post by koitsu »

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
The Coolest
Site Admin
Site Admin
Posts: 3379
Joined: Tue Feb 18, 2003 7:48 pm
Location: Tel Aviv, Israel
Contact:

Re: Feature request: CPU C-states

Post by The Coolest »

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.
Main rig:
AMD Ryzen 9 5950X (True Spirit 140 Direct) / Mobo: Asrock Fatal1ty X470 / EVO 970 500GB + WD Blue 250GB + HDD / GPU: Dell RX 570 4GB / Mem: 2x16GB DDR4-3200 G.Skill 32GTZKW TridentZ - 32GB total / PSU: Seasonic Prime Ultra Gold 650W
NAS:
Core i7 2600K 3.4GHz @ 4.3GHz (Scythe Mugen2) / Mobo: Biostar TP67XE / 2x Inland Pro 120GB + HDDs / GPU: ATi Mach64 VT2 / Mem: 4x4GB DDR3-1600 G.Skill 8GBXL RipJawsX - 16GB total / PSU: Seasonic S12II 620W.
Secondary rigs:
Core i3 7130U / MiniPC / SanDisk SDSSDP-128G / GPU: Intel HD 620 / Mem: 1x8GB DDR3L-1600
Xeon X3430 2.40GHz @ 3.06GHz or Core i3 540 3.06GHz @ 4.0GHz (Freezer 7 Pro) / Mobo: MSI H55M-ED55 / PNY CS1111 240GB / GPU: ATI FirePro V3800 / Mem: 4x2GB DDR3-1600 G.Skill 4GBRL RipJaws - 8GB total / PSU: Seasonic S12II 620W
AMD Phenom II X4 B93 / Mobo: ASUS M2A-VM / GPU: ATI Radeon Xpress X1250 / Crucial M4 120GB / Mem: 2x2GB DDR2-800 - 4GB total / PSU: Antec 380W.

Core Temp - Accurate temperature monitor for Intel's Core/Core 2 and AMD64 processors

User avatar
koitsu
Registered User
Registered User
Posts: 3
Joined: Fri Apr 29, 2011 10:06 am
Location: A world gone mad

Re: Feature request: CPU C-states

Post by koitsu »

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!

Post Reply

Return to “Development”