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)
Jan 29 2024, 10:50 AM
Unknown Object (File)
Dec 20 2023, 5:55 AM
Unknown Object (File)
Dec 14 2023, 7:03 AM
Unknown Object (File)
Nov 7 2023, 6:14 PM
Unknown Object (File)
Oct 6 2023, 5:06 PM
Unknown Object (File)
Sep 23 2023, 11:56 AM
Unknown Object (File)
Sep 17 2023, 6:03 AM
Unknown Object (File)
Sep 17 2023, 5:57 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42573
Build 39461: arc lint + arc unit

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
104

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.