Page MenuHomeFreeBSD

Fix epoch's use of turnstile_lock().
ClosedPublic

Authored by markj on Jul 24 2019, 1:39 AM.
Tags
None
Referenced Files
F171536195: D21048.diff
Fri, Sep 11, 3:39 PM
F171535808: D21048.id60114.diff
Fri, Sep 11, 3:36 PM
F171535800: D21048.id60072.diff
Fri, Sep 11, 3:36 PM
Unknown Object (File)
Thu, Sep 3, 2:28 PM
Unknown Object (File)
Thu, Sep 3, 8:11 AM
Unknown Object (File)
Thu, Sep 3, 7:17 AM
Unknown Object (File)
Thu, Sep 3, 7:17 AM
Unknown Object (File)
Thu, Sep 3, 5:44 AM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable