Page MenuHomeFreeBSD

sched: spit sched_ap_entry() out of sched_throw()
ClosedPublic

Authored by kevans on Nov 4 2021, 12:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 7:07 AM
Unknown Object (File)
Oct 4 2024, 12:19 PM
Unknown Object (File)
Oct 4 2024, 11:57 AM
Unknown Object (File)
Oct 4 2024, 7:03 AM
Unknown Object (File)
Oct 1 2024, 1:42 PM
Unknown Object (File)
Oct 1 2024, 1:04 AM
Unknown Object (File)
Sep 22 2024, 8:57 AM
Unknown Object (File)
Sep 22 2024, 2:50 AM

Details

Summary

sched_throw() can no longer take a NULL thread, APs enter through
sched_ap_entry() instead. This completely removes branching in the
common case. No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib added inline comments.
sys/kern/sched_4bsd.c
1708

I would group this MPASS together with td != NULL

This revision is now accepted and ready to land.Nov 4 2021, 12:44 AM
markj added inline comments.
sys/kern/sched_ule.c
2987

Maybe explain why: it's important to not enable interrupts until the CPU is running in a threaded context.

sys/sys/sched.h
105

Keep them sorted?

sys/kern/sched_ule.c
2987

Sure, how about (with wrapping fixed):

/*
 * sched_throw_grab() chooses a thread from the queue to switch to
 * next.  It returns with the tdq lock dropped in a spinlock section to
 * keep interrupts disabled until the CPU is running in a proper threaded
 * context.
 */
sys/kern/sched_ule.c
2987

Seems ok to me.

This revision was automatically updated to reflect the committed changes.
kevans marked 2 inline comments as done.