Page MenuHomeFreeBSD

unix: Use a dedicated mtx pool for vnode name locks
ClosedPublic

Authored by jhb on Sep 26 2024, 1:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 17, 9:39 AM
Unknown Object (File)
Tue, Apr 14, 12:15 PM
Unknown Object (File)
Tue, Apr 14, 7:47 AM
Unknown Object (File)
Mon, Apr 13, 9:22 PM
Unknown Object (File)
Mar 13 2026, 4:58 PM
Unknown Object (File)
Mar 12 2026, 9:30 PM
Unknown Object (File)
Feb 15 2026, 5:44 AM
Unknown Object (File)
Feb 11 2026, 12:04 AM
Subscribers

Details

Summary

mtxpool_sleep should be used as a leaf lock since it is a general
purpose pool shared across many consumers. Holding a pool lock while
acquiring other locks (e.g. the socket buffer lock in soreserve()) can
trigger LOR warnings for unrelated code.

Sponsored by: Chelsio Communications

Diff Detail

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

Event Timeline

jhb requested review of this revision.Sep 26 2024, 1:22 AM

The LORs I was seeing before were mitigated by rGaec2ae8b57fc638fa3ba9fac9d2067f2049ab613. However, I do think in general that locks from the global mutex pools should only be used as leaf locks.

Also, the count of 1024 locks might be too high here. I just copied the default size of the mtxpool_sleep pool. We could use a smaller value like 128 or 64 if we don't think these will be contested very often.

We definitely should go with a much lower value. The pool is used only during connect/close/detach of a named socket, which is definitely not a hot path in any sane workload.

This revision is now accepted and ready to land.Sep 30 2024, 7:04 PM

Ok, I'll drop it to 32 for commit then.