Page MenuHomeFreeBSD

Rework handling of thread sleeps before timers are working.
ClosedPublic

Authored by jhb on Mar 24 2016, 12:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 5:25 PM
Unknown Object (File)
Sep 27 2024, 5:01 AM
Unknown Object (File)
Sep 21 2024, 6:17 AM
Unknown Object (File)
Sep 20 2024, 3:44 PM
Unknown Object (File)
Sep 20 2024, 12:39 PM
Unknown Object (File)
Sep 20 2024, 1:48 AM
Unknown Object (File)
Sep 19 2024, 7:29 AM
Unknown Object (File)
Sep 17 2024, 6:32 PM
Subscribers

Details

Summary

Rework handling of thread sleeps before timers are working.

Previously, calls to *sleep() and cv_*wait*() immediately returned during
early boot. Instead, permit threads that request a sleep without a
timeout to sleep as wakeup() works during early boot. Sleeps with
timeouts are harder to emulate without working timers, so just punt and
panic explicitly if any thread tries to use those before timers are
working. Any threads that depend on timeouts should either wait until
SI_SUB_KICK_SCHEDULER to start or they should use DELAY() until timers
are available.

Until APs are started earlier this should be a no-op as other kthreads
shouldn't get a chance to start running until after timers are working
regardless of when they were created.

Test Plan
  • boot kernels both with just this change but also with the rest of the early AP startup patches with EARLY_AP_STARTUP applied

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2997
Build 3027: arc lint + arc unit

Event Timeline

jhb retitled this revision from to Rework handling of thread sleeps before timers are working..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: kib.

What about lockmgr, it also uses sleepq_timedwait() ?

Might be, the cold panic should be moved to sleepq_timedwait() ?

In D5724#122295, @kib wrote:

What about lockmgr, it also uses sleepq_timedwait() ?

Might be, the cold panic should be moved to sleepq_timedwait() ?

Mmmm, yes.

jhb edited edge metadata.
  • Move the panic for timed sleeps into sleepq_set_timeout_sbt().
kib edited edge metadata.
This revision is now accepted and ready to land.Mar 31 2016, 5:37 PM
This revision was automatically updated to reflect the committed changes.