mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-26 19:30:24 +00:00
Merge pull request #336 from sched-ext/rustland-max-time-slice-limit
scx_rustland: never use a time slice that exceeds the default value
This commit is contained in:
commit
def1ad2947
@ -534,7 +534,8 @@ impl<'a> Scheduler<'a> {
|
||||
// Moreover, ensure that the time slice is never less than 0.25 ms to prevent
|
||||
// excessive penalty from assigning time slices that are too short and reduce
|
||||
// context switch overhead.
|
||||
let slice_ns = (task.vruntime - self.min_vruntime).max(NSEC_PER_MSEC / 4);
|
||||
let slice_ns =
|
||||
(task.vruntime - self.min_vruntime).clamp(NSEC_PER_MSEC / 4, self.slice_ns);
|
||||
|
||||
// Update global minimum vruntime.
|
||||
self.min_vruntime = task.vruntime;
|
||||
|
Loading…
Reference in New Issue
Block a user