Commit 9360981
committed
scx_p2dq: Add energy-aware scheduling with thermal and frequency awareness
Implement energy-aware scheduling (EAS) for big.LITTLE architectures.
Key features:
- Thermal pressure tracking infrastructure using cpu_ctx->perf field
- Frequency-invariant effective capacity calculation using scx_bpf_cpuperf_cur()
- Energy-aware idle CPU selection with thermal, capacity, and cost scoring
- Thermal-aware CPU selection for MODE_PERF and MODE_EFFICIENCY paths
- Task placement based on utilization (little cores for <25%, big cores for >75%)
Implementation details:
- get_effective_cpu_capacity() now scales by frequency: (base - thermal) * freq / 1024
- select_best_idle_cpu() scores CPUs: capacity * 10 - energy_cost / 10
- pick_idle_energy_aware() handles preferred/fallback core type selection
- pick_idle_thermal_aware() provides lightweight thermal avoidance for mode-based scheduling
Statistics added for monitoring:
- P2DQ_STAT_THERMAL_KICK/AVOID: Thermal pressure events
- P2DQ_STAT_EAS_LITTLE_SELECT/BIG_SELECT/FALLBACK: EAS placement decisions
Enable with --enable-eas true flag.
Signed-off-by: Daniel Hodges <[email protected]>1 parent 5561ee3 commit 9360981
7 files changed
+774
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
0 commit comments