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
Unknown Object (File)
Thu, Sep 17, 4:30 AM
Unknown Object (File)
Wed, Sep 16, 11:13 AM
Unknown Object (File)
Sun, Sep 6, 3:34 AM
Unknown Object (File)
Sun, Sep 6, 1:32 AM
Unknown Object (File)
Sat, Sep 5, 6:13 PM
Unknown Object (File)
Sat, Sep 5, 3:44 AM
Unknown Object (File)
Fri, Sep 4, 7:15 PM
Unknown Object (File)
Thu, Sep 3, 6:15 PM
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 Not Applicable
Unit
Tests Not Applicable

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.