Skip to content

Commit

Permalink
Merge pull request #260 from danieljordan10/rusty-lb-fixes
Browse files Browse the repository at this point in the history
scx_rusty: load balancing fixes
  • Loading branch information
Byte-Lab authored May 2, 2024
2 parents 4fad916 + de2773d commit 8fe900e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scheds/rust/scx_rusty/src/load_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ impl LoadEntity {
}

fn xfer_between(&self, other: &LoadEntity) -> f64 {
self.imbal().min(other.imbal()).abs() * self.xfer_ratio
self.imbal().abs().min(other.imbal().abs()) * self.xfer_ratio
}
}

Expand Down Expand Up @@ -714,11 +714,8 @@ impl<'a, 'b> LoadBalancer<'a, 'b> {
continue;
}

let weight = (task_ctx.weight as f64).min(self.infeas_threshold);

let rd = &task_ctx.dcyc_rd;
let load = weight
* ravg_read(
let mut load = ravg_read(
rd.val,
rd.val_at,
rd.old,
Expand All @@ -728,6 +725,11 @@ impl<'a, 'b> LoadBalancer<'a, 'b> {
RAVG_FRAC_BITS,
);

if self.lb_apply_weight {
let weight = (task_ctx.weight as f64).min(self.infeas_threshold);
load *= weight;
}

dom.tasks.insert(
TaskInfo {
pid: *pid,
Expand Down

0 comments on commit 8fe900e

Please sign in to comment.