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)
Sun, Apr 5, 6:34 AM
Unknown Object (File)
Sat, Apr 4, 10:06 AM
Unknown Object (File)
Thu, Mar 26, 6:04 AM
Unknown Object (File)
Tue, Mar 24, 9:16 AM
Unknown Object (File)
Mar 8 2026, 5:55 AM
Unknown Object (File)
Feb 24 2026, 10:34 PM
Unknown Object (File)
Feb 24 2026, 5:13 PM
Unknown Object (File)
Feb 24 2026, 2:20 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.