Page MenuHomeFreeBSD

witness: report a thread that can't sleep in WITNESS_WARN
ClosedPublic

Authored by glebius on Feb 16 2026, 10:55 PM.
Tags
None
Referenced Files
F166958694: D55316.id173211.diff
Tue, Aug 18, 3:52 AM
Unknown Object (File)
Mon, Aug 17, 9:26 PM
Unknown Object (File)
Mon, Aug 17, 9:49 AM
Unknown Object (File)
Thu, Aug 13, 12:54 AM
Unknown Object (File)
Wed, Aug 12, 1:24 PM
Unknown Object (File)
Wed, Aug 12, 12:06 AM
Unknown Object (File)
Mon, Aug 10, 8:42 AM
Unknown Object (File)
Mon, Aug 10, 6:58 AM
Subscribers

Details

Summary

Although this is not related to locking, but seems to be the right
place to catch violators, given that WITNESS_WARN is already used
widely in the kernel.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71206
Build 68089: arc lint + arc unit

Event Timeline

Immediately caught in bridge(4):

NET_EPOCH_ENTER(et);

callout_drain(&sc->sc_brcallout);
kib added inline comments.
sys/kern/subr_witness.c
2140

IMO it is cleaner to inline THREAD_CAN_SLEEP() because the whole function operates on td.
The right hand of && is not style-compliant.

This revision is now accepted and ready to land.Feb 17 2026, 2:53 AM
markj added inline comments.
sys/kern/subr_witness.c
2144

Immediately caught in bridge(4):

NET_EPOCH_ENTER(et);

callout_drain(&sc->sc_brcallout);

Are we waiting for this?
Do you want me to work on bridge?

  • Apply Kostik's & Mark's suggestions
This revision now requires review to proceed.Mar 5 2026, 6:42 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 5 2026, 6:44 PM
This revision was automatically updated to reflect the committed changes.