4 ms·
> One process runs for a bit of time, then it is suspended while the other processes waiting to run take turns running for a while. The time slice is usually a
by vesinisa 7y ago
> One process runs for a bit of time, then it is suspended while the other processes waiting to run take turns running for a while. The time slice is usually a few milliseconds so you don't really notice it that much when your system is not under high load. (It'd be really interesting to find out how long time slices usually are in Linux.)
Isn't this the famous kernel HZ? It was originally 100 (interrupts/second), but nowadays often 250 or 1000:
http://man7.org/linux/man-pages/man7/time.7.html http://man7.org/linux/man-pages/man7/time.7.html
- bri3d 7y agoIt’s much more complex than that these days. With the CFS scheduler a process will run for somewhere between the target latency (basically the size of slice that N processes waiting to be scheduled are competing for, I think defaulted to 20ms) as the upper bound and the minimum granularity (the smallest slice that may be granted to a process being scheduled) as the lower bound, I think defaulted to 4ms. This is made more complex by the ability to configure the scheduler with high granularity, including the ability to schedule different processors and process groups with different schedulers (and the rules that govern how the schedulers can then preempt each other).
- vesinisa 7y agoStill, no scheduler can operate on granularity lower than the fundamental kernel tick rate. Which is by default 4 ms (1000 ms / 250), as you said.