HomeFreeBSD

PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock

Description

PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock

There is no need to have it for the priority check (that the thread
doesn't have a higher priority than the mutex's ceiling), and there's
also no need to take it if the thread doesn't have privileges to set its
priority to the mutex's ceiling.

While here, turn 'su' into a 'bool' and compute the internal priority
corresponding to the mutex's ceiling once and for all, putting it in new
'new_pri'.

Reviewed by: kib
Approved by: emaste (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44045

(cherry picked from commit 39e4665c9694b9f9b07d1cfa85befc288cabe906)

Approved by: emaste (mentor)

Details

Provenance
olceAuthored on Feb 22 2024, 9:13 AM
Reviewer
kib
Differential Revision
D44045: PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock
Parents
rGf5a145cb0a5f: PP mutexes: lock: Check if priority is too high against base one
Branches
Unknown
Tags
Unknown