Windows 10
A Microsoft operating system that runs on personal computers and tablets.
6,745 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Good day.
I want to programmatically disable on Windows10 C3, C4, C5, C6 states of CPU. I tried this code:
const GUID processor_idle_state_maximum = {0x9943e905, 0x9a30, 0x4ec1, 0x9b, 0x99, 0x44, 0xdd, 0x3b, 0x76, 0xf7, 0xa2};
GUID *scheme;
const DWORD DISABLED = 1;
DWORD error;
error = PowerGetActiveScheme(NULL, &scheme);
error = PowerWriteACValueIndex(NULL, scheme, &GUID_PROCESSOR_SETTINGS_SUBGROUP, &processor_idle_state_maximum, DISABLED);
error = PowerWriteDCValueIndex(NULL, scheme, &GUID_PROCESSOR_SETTINGS_SUBGROUP, &processor_idle_state_maximum, DISABLED);
error = PowerSetActiveScheme(NULL, scheme);
But this does nothing (I checked it in PerfMon.exe). As value DISABLED I tried all possible values from 1 to 20.
And how to disable C2, C3, C4, C5, C6 states of CPU?
Guid PROCESSOR_IDLE_DISABLE disable ALL C-states and set CPU usage to 100% (I already know about this guid and test it). But I want to leave C1 and C2 states enabled as it in my question above.
Does the question work for you? You can try PROCESSOR_POWER_POLICY.
@Xiaopo Yang - MSFT
Regarding function WriteProcessorPwrScheme and similar:
"Starting with Windows Vista, power management configuration of the system's processor is controlled through the GUID_PROCESSOR_SETTINGS_SUBGROUP power settings subgroup."
See Remarks section here https://learn.microsoft.com/en-us/windows/win32/api/powrprof/nf-powrprof-writeprocessorpwrscheme
In my question is Windows 10.
The most possible power setting guid I found is Processor performance core parking maximum and minimum cores.
But this has nothing with C states of processor.
Hello @Jiří Mikeska, I have consulted for this. You may turn to the hardware driver. Processor power management options don't involve in CPU C-states.
Sign in to comment