HomeFreeBSD

mtx: retire _mtx_release_lock_quick

Description

mtx: retire _mtx_release_lock_quick

The macro is misleading and of questionable value to begin with.

For starters, it is used for both spinlocks and regular mutexes (the
latter only the in the slow path), which have fundamentally different
requirements on unlock -- spinlocks are guaranteed to not have blocked
waiters and can blindly do a store.

The commentary above the it is also head-scratching:

Release mtx_lock quickly, assuming we own it.

You can't *just* release a sleepable mutex "quickly". The only legal use
right now is when the turnstile lock is held.

Note that unlock of a sleepable mutex without using RMW atomics is very
much possible and may show up soon (tm).

Sponsored by: Rubicon Communications, LLC ("Netgate")

Details

Provenance
mjgAuthored on Oct 5 2025, 3:38 PM
Parents
rGd0a35ec01c31: pipe: consistently use PIPE_LOCK_ASSERT
Branches
Unknown
Tags
Unknown