diff options
Diffstat (limited to 'src/scheduler.rs')
| -rw-r--r-- | src/scheduler.rs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/scheduler.rs b/src/scheduler.rs index 42d480e..0a83b12 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -216,10 +216,22 @@ impl<'a> Scheduler<'a> { // Low budget tasks go to e-cores let cpu = self.e_core_selector.next_core(task.cpu); + if cpu >= 0 { - dispatched_task.cpu = cpu; + //dispatched_task.cpu = cpu; + // TODO: Fix efficiency core allocation + //dispatched_task.flags |= RL_CPU_ANY as u64; } else { - dispatched_task.flags |= RL_CPU_ANY as u64; + //dispatched_task.flags |= RL_CPU_ANY as u64; + } + // If it's our own process, schedule it to core 1 + if task.pid == self.own_pid { + dispatched_task.cpu = 1; + // dispatched_task.flags |= RL_CPU_ANY as u64; + } else { + // Schedule all other tasks on core 0 + // dispatched_task.flags |= RL_CPU_ANY as u64; + dispatched_task.cpu = 0; } // Scheduler tasks get longer slices @@ -242,7 +254,7 @@ impl<'a> Scheduler<'a> { fn cleanup_old_tasks(&mut self) { let current = Instant::now(); for (pid, last_scheduled) in &self.managed_tasks { - if current - *last_scheduled > Duration::from_secs(5) { + if current - *last_scheduled > Duration::from_secs(500) { self.to_remove.push(*pid); } } |
