HomeFreeBSD

umtx: Fix a bug in do_lock_pp()

Description

umtx: Fix a bug in do_lock_pp()

If the lock is unowned (i.e., owner == UMUTEX_CONTESTED), we might get a
spurious failure, and in that case we need to retry the loop.
Otherwise, the calling thread can end up sleeping forever.

The same problem exists in do_set_ceiling(), which open-codes
do_lock_pp(), so fix it there too.

Reviewed by: olce
Reported by: Daniel King <dmking@adacore.com>
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D49031

(cherry picked from commit 4b79443927ec2c53514e73b06eb2a9d241882585)

Details

Provenance
markjAuthored on Feb 22 2025, 1:23 AM
Reviewer
olce
Differential Revision
D49031: umtx: Fix a bug in do_lock_pp()
Parents
rGbec64e75a5a8: bhyve: Avoid holding /dev/pci open unnecessarily
Branches
Unknown
Tags
Unknown