3 ms·
Curious, does Linux take this into account when it schedules processes? (Of course, it can't know the execution time of a process beforehand, but it can deprio
by amelius 7y ago
Curious, does Linux take this into account when it schedules processes?
(Of course, it can't know the execution time of a process beforehand, but it can deprioritize long-running processes, since the ETA for a long-running process is larger than for a short-running process).
- Filligree 7y agoOf a sort. It down-prioritizes processes which were previously descheduled by timer, and up-prioritizes those which are waiting for I/O. This generally has the desired effect of prioritizing interactive work. If you mean prioritization based on total CPU time then no, I don't think it does that, but the above does approximate prioritization based on a (very small) sliding window of CPU use.
- hinkley 7y agoI wonder if that policy is purely empirical or if the people who decided to favor I/O had a more sophisticated understanding of the system. Since a lot of algorithms have a log(n) component to them, either expressly or due to CPU physics, calling a function twice as often with half as much data may reduce call time a little bit, even a hair. I could see someone making a design decision based on a 2% disparity between two alternatives.