Page MenuHomeFreeBSD

LinuxKPI: use LINUXKPI_DEBUG to determine on witness lock tracing
ClosedPublic

Authored by bz on Aug 27 2026, 8:34 PM.
Referenced Files
F176166177: D59231.diff
Fri, Oct 16, 3:01 PM
Unknown Object (File)
Sun, Oct 11, 2:25 AM
Unknown Object (File)
Wed, Oct 7, 11:16 PM
Unknown Object (File)
Mon, Oct 5, 8:27 AM
Unknown Object (File)
Mon, Oct 5, 8:27 AM
Unknown Object (File)
Mon, Oct 5, 3:22 AM
Unknown Object (File)
Sun, Oct 4, 6:10 PM
Unknown Object (File)
Thu, Oct 1, 4:37 AM
Subscribers

Details

Summary

LinuxKPI by default tells witness to ignore the locks, which is
unhelpful in case of panics like 'panic: sleeping thread holds lnxspin'.
While I have edited the lock initialitzation manually in the past,
make this dependent on both LINUXKPI_DEBUG and WITNESS.
Define an internal _LKPI_MTX_NOWITNESS (and equivalent for other lock
types used) and set them accordingly in kconfig.h, a file automatically
included to all LinuxKPI compiled code (like global.h).
In addition, in the debug case, also define WITNESS_ALL to get file,
line, and lock name as a lock name rather than just, e.g., lnxspin.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Aug 27 2026, 8:34 PM
sys/compat/linuxkpi/common/include/linux/kconfig.h
43

Tell witness to not ignore .. probably better phrasing.

57

Excessive blank lines to be removed before commit.

This revision is now accepted and ready to land.Sep 10 2026, 6:39 PM

I will hold back on this one for a bit until my WITNESS mystery posted on current (and hackers previously) is solved unless someone can assure me turning this on will not immediately kill drm-kmod (drivers).

Otherwise I'll make those variables and tunables allowing us to turn them on or off or something more selectively.

Anyone care to look at the parent in the stack which adds option LINUXKPI_DEBUG to the build system, etc.?

I found out why this was not really working. I'll put a review up for fixing LINUXKPI_INCLUDES as soon as I put down linuxkpi.9 to document it.