PEPC-CSTATES(1)
π¦ PEPC-CSTATES(1) π¦
General Commands Manual β the one and only cstates command, bestie π
okay so. cstates is part of the pepc family and it's literally the main character of CPU idle-state management. it reads your C-states, it configures your C-states, it talks to remote hosts over SSH like it's nothing. no cap. let's get into it π«Ά
π Command 'cstates' π
β¨ General options β¨
these are the universal vibes β they work everywhere. π
-hβ show a short help message and then exit. the classic "wait what do i do" button.-qβ be quiet. like, only print the important stuff (warnings and things of that nature). shhh π€«-dβ print debugging information. the "tell me everything that's happening" mode.--debug-modules MODNAME[,MODNAME1,...]β so-dturns on ALL the debug messages, and this option is the vibe check that narrows them down to the modules you name. for example,-d --debug-modules MSRwill only show debug messages coming from theMSRmodule. slay, targeted debugging π--versionβ print the version number and exit. identity check β¨-H HOSTNAME,--host HOSTNAMEβ host name or IP address of the target system. thepepccommand gets executed over on that system using SSH instead of running locally. if you don't specify it, the command just runs locally. π-U USERNAME,--username USERNAMEβ the name of the user to log into the remote host as, over SSH. by default it looks up the user name in SSH configuration files. if it can't find it there, it uses the current user name.-K PRIVKEY,--priv-key PRIVKEYβ path to the private SSH key for logging into the remote host. if you don't specify one, keys configured for the host in SSH configuration files (e.g.~/.ssh/config) are used. if no keys are configured there, standard key files (e.g.~/.ssh/id_rsa) and the SSH agent get tried. π-D DATASET,--dataset DATASETβ this one is for debugging and testing. it specifies the dataset to use for emulating the host for running the command on. the datasets live in thepepcsource code repository.
the argument can be a dataset path or a name. if you specify it by name, these locations get searched, in order:
./tests/emul-datain the program's directory$PEPC_DATA_PATH/tests/emul-data$VIRTUAL_ENV/share/pepc/tests/emul-data$HOME/.local/share/pepc/tests/emul-data/usr/local/share/pepc/tests/emul-data/usr/share/pepc/tests/emul-data
--force-colorβ force colorized output even if the output stream is not a terminal (it adds ANSI escape codes). for when you want the β¨aestheticβ¨ anyway.--print-man-pathβ print thepepcmanual pages directory path and exit. add this path to theMANPATHenvironment variable to make the manual pages available to themantool. π--override-cpu-model VFMβ for debugging and testing only. it overrides the target host CPU model and forcespepcto treat the host as a specific CPU model. the format is[<Vendor>:][<Family>:]<Model>, where<Vendor>is the CPU vendor (e.g.,GenuineIntelorAuthenticAMD),<Family>is the CPU family (e.g., 6), and<Model>is the CPU model (e.g.,0x8F). example:GenuineIntel:6:0x8Ftreats the target as a Sapphire Rapids Xeon. vendor and family are optional β if you omit them, the target host values get used. family and model can be specified in decimal or hexadecimal format. π₯
π₯ Target CPU specification options π₯
all the subcommands (info, config) support these target CPU specification options. they're how you pick which CPUs you're even talking about. π―
--cpusCPUS β the list can include individual CPU numbers and CPU number ranges. for example,1-4,7,8,10-12would mean CPUs 1 to 4, CPUs 7, 8, and 10 to 12. use the special keywordallto specify all CPUs.--coresCORES β the list can include individual core numbers and core number ranges. for example,1-4,7,8,10-12would mean cores 1 to 4, cores 7, 8, and 10 to 12. use the special keywordallto specify all cores. core numbers are relative to the package.--modulesMODULES β the list can include individual module numbers and module number ranges. for example,0,2-5would mean module 0 and modules 2, 3, 4, and 5. use the special keywordallto specify all modules. note that unlike core and die numbers, module numbers are absolute. important detail, don't forget it π«--diesDIES β the list can include individual die numbers and die number ranges. for example,0-3,5would mean dies 0 to 3, and die 5. use the special keywordallto specify all dies. on some systems, die numbers are globally unique, while on other systems they are relative to the package. it's giving "depends on your platform" π¦--packagesPACKAGES β the list can include individual package numbers and package number ranges. for example,0,2-4would mean package 0 and packages 2 to 4. use the special keywordallto specify all packages.--core-siblingsCORE_SIBLINGS β core siblings are CPUs sharing the same core. the list can include individual core sibling indices or index ranges. for example, if a core includes CPUs 3 and 4, index 0 would mean CPU 3 and index 1 would mean CPU 4. > this option can only be used to reference online CPUs, because Linux does not provide topology information for offline CPUs. in the example with CPUs 3 and 4, if CPU 3 was offline, then index 0 would mean CPU 4. π«--module-siblingsMODULE_SIBLINGS β module siblings are CPUs sharing the same module. the list can include individual module sibling indices or index ranges. for example, if a module includes CPUs 3, 4, 5, and 6, index 0 would mean CPU 3, index 1 would mean CPU 4, index 2 would mean CPU 5, and index 3 would mean CPU 6. > this option can only be used to reference online CPUs, because Linux does not provide topology information for offline CPUs. in the example with CPUs 3, 4, 5, and 6, if CPU 4 was offline, then index 1 would mean CPU 5, index 2 would mean CPU 6, and index 3 would be invalid. π
π Subcommand 'info' π
retrieve C-state information for specified CPUs. by default, it displays all details for all CPUs. use the target CPU specification options to define a subset of CPUs, cores, dies, or packages. π§
-m MECHANISMS,--mechanisms MECHANISMSβ a comma-separated list of mechanisms for retrieving information. use--list-mechanismsto view available mechanisms. many options support only one mechanism (e.g.,sysfs), while others may support multiple (e.g.,sysfsandmsr). mechanisms are tried in the specified order. by default, all mechanisms are allowed, and the most preferred ones are tried first. π--list-mechanismsβ display available mechanisms for retrieving C-states information.--cstates [CSTATES]β a comma-separated list of C-states to retrieve information about, specified by name (e.g.,C1). useallto include all available Linux C-states (default). Linux C-states (e.g.,C6) are requests Linux can make, while hardware C-states (e.g., Core C6 or Package C6 on Intel platforms) are platform-specific states entered upon such requests. seehttps://github.com/dedekind/dedekind-share/blob/master/2025/cstate-namespaces.mdfor details. reads C-state information from/sys/devices/system/cpu/cpu<N>/cpuidle/state<M>/. πΈ--pkg-cstate-limitβ retrieve the current package C-state limit, available limits, and lock status. the package C-state limit defines the deepest hardware package C-state the platform can enter. it is read fromMSR_PKG_CST_CONFIG_CONTROL(0xE2), bits 2:0 or 3:0, depending on the CPU model. the lock bit (bit 15) in the same MSR determines if the OS can modify the limit. π--c1-demotionβ check if C1 demotion is enabled or disabled. on Intel platforms, this feature monitors CPU wake-up rates. if the rate exceeds a threshold, deep C-state requests are demoted to C1 to improve performance at the cost of higher power consumption. read fromMSR_PKG_CST_CONFIG_CONTROL(0xE2), bit 26.--c1-undemotionβ check if C1 undemotion is enabled or disabled. when enabled, the CPU can reverse previously demoted requests from C1 back to deeper C-states (e.g., C6) if frequent wake-ups have stopped. read fromMSR_PKG_CST_CONFIG_CONTROL(0xE2), bit 28.--c1e-autopromoteβ check if C1E autopromotion is enabled. when enabled, the CPU converts all C1 C-state requests to C1E requests. read fromMSR_POWER_CTL(0x1FC), bit 1.--cstate-prewakeβ check if C-state prewake is enabled. when enabled, the CPU considers idle timers and starts exiting deep C-states early, before the next local APIC timer event. this ensures the CPU is nearly awake by the time the timer fires. read fromMSR_POWER_CTL(0x1FC), bit 30. β°--idle-driverβ retrieve the idle driver name. the idle driver enumerates available C-states and issues C-state requests. read from/sys/devices/system/cpu/cpuidle/current_driver.--governorβ retrieve the idle governor name, which determines the C-state to request for an idle CPU. read from/sys/devices/system/cpu/cpuidle/current_governor.--governorsβ retrieve the list of available idle governors, which determine the C-state to request for an idle CPU. different governors implement various selection policies. read from/sys/devices/system/cpu/cpuidle/available_governors. the plural is a whole list, bestie ποΈ--yamlβ display output in YAML format. for the structured-output girlies π
π Subcommand 'config' π
configure C-states for specified CPUs. if no parameter is provided, the current value(s) will be displayed. use the target CPU specification options to define the subset of CPUs, cores, dies, or packages. π οΈ
-m MECHANISMS,--mechanisms MECHANISMSβ a comma-separated list of mechanisms allowed for configuring C-states. use--list-mechanismsto view available mechanisms. many options support only one mechanism (e.g.,sysfs), while some support multiple (e.g.,sysfsandmsr). mechanisms are tried in the specified order. by default, all mechanisms are allowed, and the most preferred ones are tried first.--list-mechanismsβ display available mechanisms for configuring C-states.--enable [CSTATES]β a comma-separated list of C-state names to enable. useallto include all available Linux C-states (default). Linux C-states (e.g.,C6) are requests Linux can make, while hardware C-states (e.g., Core C6 or Package C6 on Intel platforms) are platform-specific states entered upon such requests. seehttps://github.com/dedekind/dedekind-share/blob/master/2025/cstate-namespaces.mdfor details. enables a C-state by writing0to/sys/devices/system/cpu/cpu<N>/cpuidle/state<M>/disable. β--disable [CSTATES]β the evil twin of--enableπ but like, not evil, just the off switch. You tell it which C-states to disable, and it does the thing by writing1to/sys/devices/system/cpu/cpu<N>/cpuidle/state<M>/disable.- so yes, same path shape as its sibling,
<N>is the CPU,<M>is the state index, and1= "girl, stay awake". slay π
- so yes, same path shape as its sibling,
--pkg-cstate-limit [PKGCSTATELIMIT]β sets the package C-state limit, aka the deepest hardware package C-state your platform is even allowed to enter. It's giving "this is the floor, we do not go below this" π- writes to
MSR_PKG_CST_CONFIG_CONTROL(0xE2), bits2:0or3:0depending on your CPU model β yes, it literally changes based on the model, iykyk. - > β οΈ writing is refused if the lock bit (bit
15) in that same MSR is set. locked means locked, bestie, no cap. π
- writes to
--c1-demotion [on|off]β turns C1 demotion on or off. On Intel platforms this feature is literally monitoring your CPU wake-up rates like a nosy group chat π and if that rate goes over a threshold, deep C-state requests get demoted to C1. Translation: better performance, but at the cost of higher power consumption. It's a trade, not a freebie. β‘- writes to
MSR_PKG_CST_CONFIG_CONTROL(0xE2), bit26.
- writes to
--c1-undemotion [on|off]β turns C1 undemotion on or off. When it's on, the CPU can reverse those previously demoted C1 requests back to deeper C-states (thinkC6) if the frequent wake-ups have stopped. it's giving "the drama is over, we can rest again" πβ¨- writes to
MSR_PKG_CST_CONFIG_CONTROL(0xE2), bit28.
- writes to
--c1e-autopromote [on|off]β toggles C1E autopromotion. When enabled, all C1 C-state requests get converted to C1E. all of them. every single one. π- writes to
MSR_POWER_CTL(0x1FC), bit1.
- writes to
--cstate-prewake [on|off]β toggles C-state prewake. When it's on, the CPU looks at idle timers and starts exiting deep C-states early, before the next local APIC timer event even happens. The whole point? Making sure the CPU is nearly awake by the time that timer fires. it's the "setting 3 alarms so you're actually up" of power management β°π- writes to
MSR_POWER_CTL(0x1FC), bit30.
- writes to
--governor [GOVERNOR]β configures the idle governor, which is the little decision-maker that picks which C-state to request for an idle CPU. main character energy fr fr π- updates
/sys/devices/system/cpu/cpuidle/current_governor.
- updates
and that's the whole page, bestie!! π«Ά no more options, we made it to the bottom, and the footer down there just says PEPC-CSTATES(1) β that's the page name, the source, and the version/date vibe all rolled into one iconic little line. screenshot it, cite it, live laugh cpuidle πβ¨π¦
π¦ where this page comes from
- epel 10: python3-pepc 2.0.7-2.el10_3 Β· BSD-3-Clause
- epel 9: python3-pepc 2.0.7-3.el9 Β· BSD-3-Clause
- fedora 44: python3-pepc 2.0.7-2.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms