HomeFreeBSD

rmlock: Add a required compiler membar to the rlock slow path

Description

rmlock: Add a required compiler membar to the rlock slow path

The tracker flags need to be loaded only after the tracker is removed
from its per-CPU queue. Otherwise, readers may fail to synchronize with
pending writers attempting to propagate priority to active readers, and
readers and writers deadlock on each other. This was observed in a
stable/12-based armv7 kernel where the compiler had reordered the load
of rmp_flags to before the stores updating the queue.

Reviewed by: rlibby, scottl
Discussed with: kib
Sponsored by: Rubicon Communications, LLC ("Netgate")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28821

Details

Provenance
markjAuthored on Feb 24 2021, 2:15 AM
Reviewer
rlibby
Differential Revision
D28821: rmlock: Add a missing compiler membar to the rlock slow path
Parents
rG6ab923cbca87: pam_login_access: Fix negative entry matching logic
Branches
Unknown
Tags
Unknown