From nobody Thu May 09 13:26:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZt8f4YwXz5Jgkl; Thu, 09 May 2024 13:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZt8f3pdPz3x8n; Thu, 9 May 2024 13:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PqPVXEOiriALWYp8S7mkkqGBUySIBByY8LcKGOoMEk4=; b=qbYWxCTz/XDeEpi6+1mWigSG2FvvRJbPLIKfbEO2nO10KGQmGhXFOUdSSSG0jvI7e7p3wq KI8kwBjUrQgDY/ELsstZK2GIdi6PHtqiYZansR3SF0uhr5mnwjMUfhLRe8oqcJtJoeqvAl LSj0MD/qBnhpYWo7yQCCLYwMuh1HZtq9ZsviShI0EwUnQaY7cLU/UkJZkczJCnl7FcEUpN Ruqs6xBCkYvtaVIVO4HNScGmpnumG5a//0xAUoKQ+3UqlRaJ5f46thqbQqsFHNdTwS7UKy jF7mst830G3rWinF7ss+/QqKe9dNgKw7oUKU7mYe55xPV0jntGcde/MbzqPvFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261218; a=rsa-sha256; cv=none; b=Q8aSgEiE5lDGf5dQZ0d04oKeWdRs9+Qk6HVaBhO+PRsFCWgIahnbpeoZq4oXaX6Pbi4+Sw /qNMiv7b1Kim5eQikj9dLVD/rSWL9DbVclQ0uoP5MQ0qNCdmt8H8ZMvTodstUuV07wuoX/ wRmyTip7RJjC7Znjm8fsG1qi4LfkB0HakXsSQ3QrjcHFchWVHYREvBR2kQXeqkz/sRC7bS LLa5wbi71KvsCmPnmkzCvlAMd7/FkQRBsSOozgmaGX3RCjbFCufLp3HgWQBB3to43xmGrY a/M9T69k2yYdsl3slJHC6jlF9ZqMy/RjU/wVxzdHs3EcK4GPJVPSJ/dZhGpH6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PqPVXEOiriALWYp8S7mkkqGBUySIBByY8LcKGOoMEk4=; b=buJ1S/KFLEYVwPY5G5mju5pHEm4J14VEo6SJHmW1kHR/+M9u/mRbXwduwiN4Uv9RS5bIY4 y2fJ0SmClmqeBB48Ms++oO55jnl7kTSMC0XnN9C0wISKWxSTqVP9xlzfVDmyPs4TzdFoHJ lLo3Yr8upB8q28MMnq9Jv8kgyY3OOEqixLqPGzWw+jp0RoxZCmgM61J4kQS9pQOcRmfAqE HDXwNX5zu27A5kakPomrFZhDJEPYiRMh+/jfWJVFXJfAVN55XlkI3J3JfK0AnxVjy6WJxi 27WQvzU8Ld5r5XHq8JLgogX1pbLj9bH2yJ2QL/vWf9LeCmQ3vAFlt+LaPmp4pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZt8f3QGgz19LZ; Thu, 9 May 2024 13:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DQwZT049606; Thu, 9 May 2024 13:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DQwgG049603; Thu, 9 May 2024 13:26:58 GMT (envelope-from git) Date: Thu, 9 May 2024 13:26:58 GMT Message-Id: <202405091326.449DQwgG049603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f9e9c02241dc - stable/14 - PP mutexes: lock: Check if priority is too high against base one List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f9e9c02241dc887244cf62136dfcea04718290a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f9e9c02241dc887244cf62136dfcea04718290a0 commit f9e9c02241dc887244cf62136dfcea04718290a0 Author: Olivier Certner AuthorDate: 2024-02-22 08:53:51 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:26:21 +0000 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 9ac3ac9ece6269365ac314fa5fdb484e96d4a32e) Approved by: emaste (mentor) --- sys/kern/kern_umtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 9c7225863bb1..5abc1e71d763 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -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;