git: be25f6d75d26 - main - sched_4bsd.4: sync current scheduler sysctls

From: Minsoo Choo <mchoo_at_FreeBSD.org>
Date: Tue, 10 Nov 2026 22:20:39 UTC
The branch main has been updated by mchoo:

URL: https://cgit.FreeBSD.org/src/commit/?id=be25f6d75d26e233ae7501a76d79fe4898c48e40

commit be25f6d75d26e233ae7501a76d79fe4898c48e40
Author:     Minsoo Choo <mchoo@FreeBSD.org>
AuthorDate: 2026-09-25 15:43:57 +0000
Commit:     Minsoo Choo <mchoo@FreeBSD.org>
CommitDate: 2026-11-10 22:18:49 +0000

    sched_4bsd.4: sync current scheduler sysctls
    
    Reviewed by:    bcr, jhb, olce
    Approved by:    jhb, olce (mentor)
    MFC after:      2 weeks
    Sponsored by:   FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D60002
---
 share/man/man4/sched_4bsd.4 | 37 +++++++++++++++++++++----------------
 sys/kern/sched_4bsd.c       |  1 +
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/share/man/man4/sched_4bsd.4 b/share/man/man4/sched_4bsd.4
index 1f0a637fdb83..5b7d36a75e79 100644
--- a/share/man/man4/sched_4bsd.4
+++ b/share/man/man4/sched_4bsd.4
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd September 25, 2026
+.Dd November 10, 2026
 .Dt SCHED_4BSD 4
 .Os
 .Sh NAME
@@ -43,23 +43,28 @@ Common scheduler sysctls are documented in
 The following sysctls are relevant to the operation of
 .Nm :
 .Bl -tag -width indent
-.It Va kern.sched.name
-This read-only sysctl reports the name of the active scheduler.
-.It Va kern.sched.quantum
-This read-write sysctl reports or sets the length of the quantum (in
-micro-seconds) granted to a thread.
-.It Va kern.sched.ipiwakeup.enabled
-This read-write sysctl sets whether or not the scheduler will generate an
-inter-processor interrupt (IPI) to an idle CPU when a thread is woken up.
-Otherwise, idle CPUs will wait until the next clock tick before looking for
-new work.
-.It Va kern.sched.preemption
-This read-only sysctl reports whether or not the kernel is configured to
-support preemption, which reduces the latency to run lower priority threads
-on wakeup.
+.It Va kern.sched.4bsd.quantum
+The length of the timeshare quantum in microseconds.
+.It Va kern.sched.4bsd.slice
+The length of the timeshare quantum in statclock ticks.
 .El
 .Pp
-Some sysctls will be available only on systems supporting SMP.
+The following sysctls are available only on SMP systems:
+.Bl -tag -width indent
+.It Va kern.sched.4bsd.runq_fuzz
+The number of threads to examine in the highest-priority queue in search for a
+thread that last ran on the current CPU.
+If no such thread exists, the first thread is chosen.
+Negative values and 0 are treated like 1 (the default), i.e., the first thread
+in queue is always chosen.
+.It Va kern.sched.4bsd.ipiwakeup.enabled
+Whether to send an inter-processor interrupt (IPI) to an idle CPU when a
+thread is woken up.
+.It Va kern.sched.4bsd.ipiwakeup.usemask
+Whether to use the mask of idle CPUs when forwarding wakeups.
+.It Va kern.sched.4bsd.ipiwakeup.useloop
+Whether to search for idle CPUs in a loop when forwarding wakeups.
+.El
 .Sh SEE ALSO
 .Xr scheduler 4 ,
 .Xr sysctl 8
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index fc06ad8f5e1b..de676de9e0e4 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -240,6 +240,7 @@ sysctl_kern_slice(SYSCTL_HANDLER_ARGS)
 	return (0);
 }
 
+/* NOTE: Please keep sched_4bsd.4 in sync with sysctl knobs defined here. */
 SYSCTL_NODE(_kern_sched, OID_AUTO, 4bsd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
     "4BSD Scheduler");