Skip to content

Commit da8126e

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 3ba5a2c commit da8126e

File tree

7 files changed

+699
-23
lines changed

7 files changed

+699
-23
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ enum stat_idx {
8484
P2DQ_STAT_WAKE_PREV,
8585
P2DQ_STAT_WAKE_LLC,
8686
P2DQ_STAT_WAKE_MIG,
87+
P2DQ_STAT_THERMAL_KICK, /* CPU kicks due to thermal pressure */
88+
P2DQ_STAT_THERMAL_AVOID, /* Times throttled CPUs avoided */
89+
P2DQ_STAT_EAS_LITTLE_SELECT, /* Task placed on little core via EAS */
90+
P2DQ_STAT_EAS_BIG_SELECT, /* Task placed on big core via EAS */
91+
P2DQ_STAT_EAS_FALLBACK, /* EAS fallback to non-preferred core */
8792
P2DQ_NR_STATS,
8893
};
8994

0 commit comments

Comments
 (0)