HomeFreeBSD

sched_ule: Enable preemption of curthread in the load balancer

Description

sched_ule: Enable preemption of curthread in the load balancer

The load balancer executes from statclock and periodically tries to move
threads among CPUs in order to balance load. It may move a thread to
the current CPU (the loader balancer always runs on CPU 0). When it
does so, it may need to schedule preemption of the interrupted thread.
Use sched_setpreempt() to do so, same as sched_add().

PR: 264867
Reviewed by: mav, kib, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0927ff78147b4d00a75054bbad299946208e1e91)

Details

Provenance
markjAuthored on Jul 14 2022, 2:23 PM
Parents
rGa869b8c5f0ba: sched_ule: Fix racy loads of pc_curthread
Branches
Unknown
Tags
Unknown