Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/powercap

FieldValue
Subsystempower capping subsystem (Documentation/power/powercap/powercap.rst named by the ABI file); implementation file not in cached tree
Config gatenot verifiable from the cached sources (cached tree has no Kconfig or driver files); class absent on the live host
ABI documentationDocumentation/ABI/testing/sysfs-class-powercap (18 What entries)
SinceSeptember 2013, KernelVersion 3.13 (all entries)
Live (5.10.134 host)class absent: not in live-sys/class-list.txt, no /sys/class/powercap; /usr/include/linux/powercap.h not present on the host either
Ledger IDSYSC-powercap

What it represents

The power cap class: control types, power zones and constraints. A control type (for example intel-rapl) determines how power is controlled and contains power zones - single devices or device collections that can be monitored and limited. Zones nest: a package zone may contain core and uncore child zones (ABI example path intel-rapl:0:1:1). Each zone exposes an energy counter, an optional power value, and numbered constraints with limits and time windows.

Relationship to the device model

The tree is three levels deep by construction: /sys/class/powercap/<control type>/<power zone>/<child power zone>. Zone names qualified by control type (intel-rapl:0:1:1) identify position in the hierarchy. enabled exists at both control-type level (affects every zone using that type) and zone level (applies to the zone and its children), so enabling is hierarchical.

Attributes

AttributeR/WUnit/formatConditional?Source
<control type>/enabledRW0/1 power capping enable for the typecontrol typeABI, 3.13
<power zone>/nameROzone namezoneABI, 3.13
<power zone>/energy_ujRWmicro-joules counter; write 0 resets; RO if not resettablezoneABI, 3.13
<power zone>/max_energy_range_ujROrange of the energy counter, micro-jouleszoneABI, 3.13
<power zone>/power_uwROcurrent power, micro-wattszone supporting powerABI, 3.13
<power zone>/max_power_range_uwROrange of the power value, micro-wattszone supporting powerABI, 3.13
<power zone>/enabledRW0/1; applies to zone and childrenzoneABI, 3.13
<zone>/constraint_X_nameROoptional constraint name, X = 0..max integerconstraint presentABI, 3.13
<zone>/constraint_X_power_limit_uwRWpower limit in micro-watts over the X time windowconstraint presentABI, 3.13
<zone>/constraint_X_time_window_usRWtime window in micro-secondsconstraint presentABI, 3.13
<control type>/.../constraint_X_max_power_uwROmaximum allowed power, micro-wattsconstraint presentABI, 3.13
<control type>/.../constraint_X_min_power_uwROminimum allowed power, micro-wattsconstraint presentABI, 3.13
<zone>/constraint_X_max_time_window_usROmaximum allowed time windowconstraint presentABI, 3.13
<zone>/constraint_X_min_time_window_usROminimum allowed time windowconstraint presentABI, 3.13

Safety and writes

Reads are safe; energy_uj is the data source for power meters such as turbostat-style tools. Writes are the enforcement path: constraint power limits and time windows throttle real hardware immediately, and enabled toggles switch capping on or off for whole zones. energy_uj accepts the write 0 to reset the counter, but only where the hardware allows reset. Values are bounded by the min/max constraint files; out-of-range writes fail. This is power-plant-level policy - a wrong limit can slow every workload on the machine.

References

  • Documentation/ABI/testing/sysfs-class-powercap (cached copy; 18 What entries)
  • Documentation/power/powercap/powercap.rst named by the ABI file; not in cached tree
  • Host check: /usr/include/linux/powercap.h absent (verified), so no local uapi citation
  • Sibling page: power; coverage: ledger
  • Live check: /sys/class/powercap absent (kernel 5.10.134, read-only enumeration)