Please see overview of project at D45393.
Now that a difference of 1 in priority level is significant, we can
shrink the priority range reserved for kernel threads.
Only four distinct levels are necessary for the bottom half (3 base
levels and arguably an additional one for demoted interrupt threads that
run for full time slices so that they finally don't compete with other
ones). To leave room for other possible uses, we settle on 8 levels.
Given the symbolic constants for the top half, 10 levels are currently
necessary. We settle on 16 levels.
This allows to enlarge the timesharing range, which covers ULE's both
interactive and batch range, to 168 distinct levels from less than 64
ones for ULE (as of before the changes to make it use a single runqueue
and have 256 distinct levels per runqueue) and 34 ones for 4BSD.
While here, note that the realtime range is required to have at least 32
priority levels since:
- POSIX mandates at least 32 distinct levels for the SCHED_RR/SCHED_FIFO scheduling policies.
- We directly map contiguous priority levels ('sched_priority') of these scheduling policies to distinct, contiguous internal priority levels.
Conversely, having at least 32 priority levels is enough to guarantee
compliance to the POSIX requirement mentioned above because different
internal priority levels are treated differently since commit "runq:
Switch to 256 levels".
While here, list explicit change restrictions for the realtime and idle
range.