Page MenuHomeFreeBSD

sched: Internal priority ranges: Reduce kernel, increase timeshare
Needs ReviewPublic

Authored by olce on Mon, May 27, 10:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 3, 5:25 AM
Unknown Object (File)
Thu, May 30, 7:29 PM
Unknown Object (File)
Thu, May 30, 7:20 PM
Subscribers

Details

Reviewers
jhb
markj
mav
jeff
Summary

Please see overview of project at D45393.

Now that a difference of 1 in priority level is significant, we can
reduce the span of 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.

On the other hand, 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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57944
Build 54832: arc lint + arc unit