Page MenuHomeFreeBSD

mutex: add missing checks for SCHEDULER_STOPPED()
Needs ReviewPublic

Authored by mhorne on Nov 4 2025, 3:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 22, 2:16 AM
Unknown Object (File)
Sun, Dec 21, 3:46 AM
Unknown Object (File)
Fri, Dec 19, 12:14 PM
Unknown Object (File)
Thu, Dec 18, 9:04 AM
Unknown Object (File)
Tue, Dec 16, 2:42 AM
Unknown Object (File)
Mon, Dec 15, 11:33 PM
Unknown Object (File)
Sun, Dec 7, 7:01 PM
Unknown Object (File)
Tue, Dec 2, 11:09 AM
Subscribers

Details

Reviewers
markj
kib
rlibby
bz
Summary

This prevents recursive panics, and is ubiquitous in other lock
implementations.

Most mutex paths contain this check, but it is missing for the '_flags'
lock/unlock variants.

Diff Detail

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

Event Timeline

mhorne requested review of this revision.Nov 4 2025, 3:17 PM

I checked sx and rw locks and I only see the check in the slowpath.

If something does this in the fast path it should be patched to stop doing it.

What recursive panics are you taking about exactly? Note most of these have an inlined variant which does not do the check and which is used by default.