⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

cpufreq_ondemand_sample

Function cpufreq_ondemand_sample 

Source
pub fn cpufreq_ondemand_sample(busy_ticks: u64, total_ticks: u64)
Expand description

Sample CPU load and adjust frequency (called periodically).

Uses integer math: load_pct = (busy_ticks * 100) / total_ticks. Scales up when load > 80%, scales down when load < 20%.

busy_ticks and total_ticks are the cumulative scheduler tick counts since the last sample.