FreeBSD Status Report

Report Entry

Scheduler

Contact: Olivier Certner <olce@FreeBSD.org>
Contact: Minsoo Choo <mchoo@FreeBSD.org>

This quarter, a number of fixes and cleanups were merged to ULE and 4BSD:

  • Fix priority conflation of differently-niced CPU-bound threads (4BSD).

  • Fix priority diminishing too slowly when consuming CPU, because of some obsolete SMP scaling (4BSD).

  • Fix selecting lowest priority thread early in some corner cases (ULE).

  • Only allocate local runqueues (used for pinning/bound threads) for CPUs that are actually present (4BSD).

  • Removal of unused hlt_cpus_mask and sched_do_timer_acccounting().

  • Removal of unused kern.sched.4bsd.followon (4BSD).

  • When setting kern.sched.{4bsd,ule}.slice, check the value makes sense and make sure to update dependent internal constants such as hogticks and sched_slice_min.

  • Ensure sched_slice_min and the quantum computation stay sane for small quantum values (ULE).

  • Update some comments.

Work is on-going and nearing completion on cleaning up the machinery allowing multiple scheduler implementations (a.k.a., "instances") to co-exist in the same kernel. From a single list of function descriptors, it now automatically produces the declaration of functions in the scheduler interface and in scheduler instances, the fields of the scheduler instance descriptor structure and the dispatching functions. A second round of changes is in preparation, with the aim to potentially remove implementation functions' namespacing (e.g., having ule or 4bsd in their names) in the source code, in effect renaming them back to their old names, which are those of the interface functions, while keeping the namespacing for C symbols which is required for debugging and in general manipulation by various ELF tools.

Work continues in the background on solutions to long-standing shortcomings in the ULE scheduler such as unfairness for non-interactive threads in certain particular circumstances and the very weak effect of nice values. For more information, please consult the previous report, and the slides of the latest presentation at EuroBSDCon2026’s DevSummit.

Sponsor: The FreeBSD Foundation


Last modified on: October 9, 2026 by Olivier Certner