140 priority level
Each process have scheduling class
A smaller value corresponds to a higher priority
based on POSIX.4 root can only use
SCHED_FIFO
and SCHED_RR
so conventional processes can use SCHED_OTHER
- [0,99]: priority for real-time tasks (
SCHED_FIFO
andSCHED_RR
)
- [100,139]: priority for normal timesharing tasks (
SCHED_OTHER
orSCHED_NORMAL
)
just have one ready queue so the complexity is
default user process priority is 120 (midpoint)
Static priority determines the length of a time slice
Usually most of other strategy do not make dependency between them
nice is from -20 to +19 nice(), setpriority()
Dynamic priority
- To maintain good response time.
- favor I/O-bound process over CPU-bound process
- Processes which sleep a lot get a higher dynamic priority. (task’s interactivity)
- bonus reflects task’s interactivity or average sleep time