]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mi_switch(): clean up switch types and their usage
authorMitchell Horne <mhorne@FreeBSD.org>
Thu, 9 Feb 2023 15:40:29 +0000 (11:40 -0400)
committerMitchell Horne <mhorne@FreeBSD.org>
Thu, 9 Feb 2023 16:01:32 +0000 (12:01 -0400)
commit1029dab63457f23dace4dab3b698f1c177939b93
treefb24264e322d90ae159f1a4b707950b26ae2ad8b
parentbff02948ed87a9e791fa901557a88ae545bf3df7
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
sys/dev/dpaa/bman_portals.c
sys/dev/dpaa/qman_portals.c
sys/kern/kern_poll.c
sys/kern/kern_switch.c
sys/kern/kern_synch.c
sys/kern/sched_4bsd.c
sys/kern/sched_ule.c
sys/kern/vfs_bio.c
sys/sys/proc.h