Priority range
- 0 — per-processor idle thread
- 254 — per-processor clock IST (but is configurable)
- 255 — per-processor IPI IST
Unprivileged threads can have a priority ranging from 1 to 63 (by default); threads with the PROCMGR_AID_PRIORITY ability enabled (see procmgr_ability()) are allowed to set priorities above 63. You can change the allowed priority range for unprivileged processes with the procnto -P option.
The process manager has a set of special idle threads (one per available CPU core) that have priority 0 and are always ready to run. A CPU core is considered to be idle when the idle thread is scheduled to run on that core. At any instant, a core is either idle or busy; only by averaging over time can a CPU be said to be some percent busy (e.g., 75% CPU usage).
A thread has both a real priority and an effective priority, and is scheduled in accordance with its effective priority. The thread itself can change both its real and effective priority together, but the effective priority may change because of priority inheritance or the scheduling policy. Normally, the effective priority is the same as the real priority.
- Whatever thread was running loses the CPU on the core that's handling the interrupt. On multicore machines this may vary, due to hardware configuration and BSP setup.
- The kernel runs some hardware-specific code supplied by the BSP to identify the interrupt.
- The kernel masks the interrupt, then posts a semaphore to unblock the appropriate IST.
- The kernel runs some hardware-specific code supplied by the BSP to do end-of-interrupt processing.
Out-of-range priority requests
- SCHED_PRIO_LIMIT_ERROR(priority) — indicate an error
- SCHED_PRIO_LIMIT_SATURATE(priority) — use the maximum allowed priority
(reach a
maximum saturation point
)
You can append an s or S to procnto's -P option
if you want out-of-range priority requests by default to saturate
at the maximum allowed value instead of
resulting in an error.