Skip to content

Commit 9360981

Browse files
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

File tree

7 files changed

+774
-28
lines changed

7 files changed

+774
-28
lines changed

scheds/rust/scx_p2dq/src/bpf/intf.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ enum stat_idx {
8888
P2DQ_STAT_EXEC_BALANCE,
8989
P2DQ_STAT_FORK_SAME_LLC,
9090
P2DQ_STAT_EXEC_SAME_LLC,
91+
P2DQ_STAT_THERMAL_KICK,
92+
P2DQ_STAT_THERMAL_AVOID,
93+
P2DQ_STAT_EAS_LITTLE_SELECT,
94+
P2DQ_STAT_EAS_BIG_SELECT,
95+
P2DQ_STAT_EAS_FALLBACK,
9196
P2DQ_NR_STATS,
9297
};
9398

0 commit comments

Comments
 (0)