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

Details

Provenance
markjAuthored on Feb 22 2025, 1:23 AM
Reviewer
olce
Differential Revision
D49031: umtx: Fix a bug in do_lock_pp()
Parents
rGbb1dc6cf9c36: vm_page: define partial page invalidate
Branches
Unknown
Tags
Unknown