Revert "scx_rusty: Refactor ridx assignment in populate_tasks_by_load"

This commit is contained in:
David Vernet 2024-06-26 17:35:22 -04:00 committed by GitHub
parent 41d60aef04
commit fe3ce64a9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -686,7 +686,9 @@ impl<'a, 'b> LoadBalancer<'a, 'b> {
let mut pids = vec![]; let mut pids = vec![];
let (mut ridx, widx) = (active_pids.read_idx, active_pids.write_idx); let (mut ridx, widx) = (active_pids.read_idx, active_pids.write_idx);
ridx = ridx.max(widx - MAX_PIDS); if widx - ridx > MAX_PIDS {
ridx = widx - MAX_PIDS;
}
for idx in ridx..widx { for idx in ridx..widx {
let pid = active_pids.pids[(idx % MAX_PIDS) as usize]; let pid = active_pids.pids[(idx % MAX_PIDS) as usize];