HomeFreeBSD

mi_switch(): clean up switch types and their usage

Description

mi_switch(): clean up switch types and their usage

Overall, this is a non-functional change, except for kernels built with
SCHED_STATS. However, the switch types are useful for communicating the
intent of the caller.

  1. Ensure that every caller provides a type. In most cases, we upgrade the basic yield to sched_relinquish() aka SWT_RELINQUISH.
  2. The case of sched_bind() is distinct, so add a new switch type SWT_BIND.
  3. Remove the two unused types, SWT_PREEMPT and SWT_SLEEPQTIMO.
  4. Remove SWT_NONE altogether and assert that callers always provide a type flag.
  5. Reference the mi_switch(9) man page in the comments, as these flags will be documented there.

Reviewed by: kib, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38184

Details

Provenance
mhorneAuthored on Feb 9 2023, 3:40 PM
Reviewer
kib
Differential Revision
D38184: mi_switch(): clean up switch types and their usage
Parents
rGbff02948ed87: sched_4bsd: use the same switch flags as ULE
Branches
Unknown
Tags
Unknown