mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
PP mutexes: lock: Check if priority is too high against base one
Doing this instead of using the current (user) priority, which includes
current lendings, prevents gratuitous failures for threads involved in
multiple locking groups, where each group is defined as the threads that
can lock a particular PP or PI mutex. No deadlock can occur in this
case. Indeed, if a thread holds such a lock A giving it a higher
priority than the ceiling of some other lock B that is PP, and B is
acquired by another thread, effectively the latter may not be able to
run but this situation can only last until the first thread releases A,
which it will do eventually.
Reviewed by: kib
Approved by: emaste (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44044
(cherry picked from commit 9ac3ac9ece)
Approved by: emaste (mentor)
This commit is contained in:
parent
eded8fea5c
commit
f9e9c02241
1 changed files with 1 additions and 1 deletions
|
|
@ -2551,7 +2551,7 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags,
|
|||
}
|
||||
|
||||
mtx_lock(&umtx_lock);
|
||||
if (UPRI(td) < PRI_MIN_REALTIME + ceiling) {
|
||||
if (td->td_base_user_pri < PRI_MIN_REALTIME + ceiling) {
|
||||
mtx_unlock(&umtx_lock);
|
||||
error = EINVAL;
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in a new issue