Skip to content

Commit

Permalink
fix: 相对cpu频率范围限制逻辑错误
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow3aaa committed Dec 29, 2024
1 parent 4f434f6 commit 4b2f447
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cpu_common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl Controller {
})
.collect();

for cpu in self.cpu_infos.iter_mut().rev() {
for cpu in self.cpu_infos.iter_mut() {
let freq = fas_freqs.get(&cpu.policy).copied().unwrap();
let freq = match *EXTRA_POLICY_MAP
.get()
Expand All @@ -182,7 +182,7 @@ impl Controller {
ExtraPolicy::RelRangeBound(ref rel_bound) => {
let rel_to_freq = fas_freqs.get(&rel_bound.rel_to).copied().unwrap();
freq.clamp(
rel_to_freq + rel_bound.min.unwrap_or(0),
rel_to_freq + rel_bound.min.unwrap_or(isize::MIN),
rel_to_freq + rel_bound.max.unwrap_or(isize::MAX),
)
}
Expand Down

0 comments on commit 4b2f447

Please sign in to comment.