Skip to content

Power Capping Linux

Srinivas Pandruvada

Blue TeamThe Linux Foundation42 minOpen on YouTube ↗

Investigates power Capping Linux and evaluates key implications for security practitioners.

Summary

### Overview Presented by Srinivas Pandruvada (referred to as Srinivas Pavaada in transcript phonetic recognition), a software engineer at the Intel Open Source Technology Center with contributions from Jacob Pan and Len Brown, this talk examines power capping techniques in Linux. In data centers and mobile environments, unpredictable workloads often force operators to over-provision capacity for worst-case scenarios, leading to low baseline utilization and massive safety margins. Power capping provides a mechanism to enforce power limits across entire systems or specific subsystems (such as CPUs, GPUs, and memory) and dynamically redistribute power budgets to prioritize critical tasks without exceeding physical or thermal limits.

### Key Topics - **Over-Budgeting and Power Constraints:** Why data centers and mobile hardware suffer from over-provisioning due to unpredictable spikes, physical cooling constraints, and battery thermal risks. - **Power Capping Participants:** Key power consumers targeted for capping, primarily CPU, GPU, and RAM, alongside potential components like wireless and multimedia. - **Control Mechanisms:** Analysis of multiple power limitation methods: P-states (voltage/frequency pairs and turbo ranges), Intel RAPL (Running Average Power Limit), T-states (throttling/duty-cycling), idle injection (via drivers like `intel_powerclamp`), CPU offlining, and ACPI power meters / processor aggregators (ACPI PAD). - **Linux Power Capping Framework RFC:** A proposal for a unified sysfs and class-driver kernel interface to model power zones, control types, hierarchies, and constraints across diverse hardware.

### Technical Details - **Intel RAPL (Running Average Power Limit):** Introduced with Sandy Bridge, RAPL provides a digital model-based power meter and closed-loop limiting mechanism implemented near the silicon. It exports capabilities via MSRs and PCI configuration space across domains (package, core/CPU, uncore/GPU, DRAM). It supports short-term and long-term time windows and returns performance feedback counters (e.g., time throttled). - **P-States vs. T-States:** P-states control operational voltage-frequency pairs. Between P1 and P0 sits the hardware-controlled turbo state, which scales with active cores. In contrast, T-states enforce clock stopping/duty cycles (e.g., 25% duty cycle). While T-states cause severe performance degradation at high power levels, they remain capable of restricting power at low boundaries where RAPL or P-states saturate. - **Idle Injection (`powerclamp`):** Implemented in Linux 3.9 as a thermal cooling device, idle injection schedules high-priority threads on online CPUs to force them into deep idle C-states based on a user-defined ratio (0–50%). In lower power bands, it maintains significantly better performance than T-states. - **CPU Offlining & ACPI PAD:** Offlining cores migrates timers and threads, but physical offlining depends on BIOS support and produces non-linear drops due to core/thread topology. ACPI Processor Aggregator (PAD) drivers similarly offload processors into deep C-states for short-term thermal emergencies. - **Unified Power Capping Framework:** The proposed Linux framework structures hardware into `control_type` containers holding hierarchical `power_zone` entities (parent-child physical relationships, such as package containing CPU and GPU). Each power zone supports energy status reporting and up to 10 independent `constraints` (defined by power limit, time window, and name), offering user space a consistent interface similar to Linux regulators or power supplies.

### Takeaways Srinivas outlines a recommended hierarchy of power capping mechanisms: RAPL should be prioritized within its operable range due to superior responsiveness and performance retention, followed by idle injection and CPU offlining. T-states should be reserved as a last resort for extremely low power boundaries. The Linux power capping framework RFC standardizes these disparate controls under a single sysfs model, enabling tools like PowerTOP and user-space management daemons to govern power across vendors and device classes uniformly.

Related talks