feat: HWP scaling, C1E, closed-loop thermal governor for Intel CPUs
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user