Page MenuHomeFreeBSD

Fix epoch's use of turnstile_lock().
ClosedPublic

Authored by markj on Jul 24 2019, 1:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 10:41 PM
Unknown Object (File)
Sep 16 2023, 10:34 PM
Unknown Object (File)
Sep 6 2023, 11:22 PM
Unknown Object (File)
Sep 6 2023, 11:15 PM
Unknown Object (File)
Sep 6 2023, 11:09 PM
Unknown Object (File)
Sep 1 2023, 5:19 PM
Unknown Object (File)
Jun 29 2023, 8:52 AM
Unknown Object (File)
Jun 25 2023, 4:05 PM
Subscribers

Details

Summary

turnstile_lock() was added specifically for use in epoch. While waiting
for readers to drain, if the blocking thread discovers a reader blocked
on a turnstile, it will also block on the turnstile. It previously
returned the value of the ts_owner field to indicate that the turnstile
was successfully locked, and NULL to indicate that the race was lost.
But, ts_owner may be NULL if the turnstile corresponds to a rw lock
owned by one or more readers, in which case the epoch code leaked the
turnstile lock and chain lock.

Apply a minimal fix: simply return the owner as a separate value.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25478
Build 24097: arc lint + arc unit