feat: HWP scaling, C1E, closed-loop thermal governor for Intel CPUs

This commit is contained in:
2026-07-05 10:51:11 +02:00
parent 46c56b057b
commit 35e5aba23f
19 changed files with 903 additions and 9 deletions
+11
View File
@@ -18,6 +18,7 @@
#include <Hal/Apic/Interrupts.hpp>
#include <Hal/GDT.hpp>
#include <Hal/SmpBoot.hpp>
#include <Hal/CpuPower.hpp>
#include <Timekeeping/ApicTimer.hpp>
#include <Api/WinServer.hpp>
#include <Api/Heap.hpp>
@@ -811,6 +812,11 @@ namespace Sched {
}
ReclaimTerminated();
// Thermal governor step (rate-limited internally to 500 ms).
// Runs here because BSP maintenance is reached from both the idle
// loop and the timer tick, so it keeps running under full load.
Hal::CpuPower::ThermalTick(Timekeeping::GetMilliseconds());
}
uint64_t GetNextDeadlineTick() {
@@ -922,6 +928,11 @@ namespace Sched {
void Tick(uint32_t elapsedMs) {
auto* cpu = Smp::GetCurrentCpuData();
// Pick up thermal-governor frequency changes (HWP requests are
// per-core MSRs, so every CPU applies them itself). No-op unless
// the governor bumped the policy epoch since our last tick.
Hal::CpuPower::ApplyPolicyIfChanged();
// BSP: wake sleeping processes and reclaim terminated slots
if (cpu->cpuIndex == 0) {
RunBspMaintenance();