From nobody Tue May 14 13:39:24 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 4VdyBh6h9jz5K780; Tue, 14 May 2024 13:39:24 +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 4VdyBh64fqz4Pbs; Tue, 14 May 2024 13:39:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715693964; 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=nHJ6TvibdUoBsFQZ7x3la0iCF8NToTz/W/b8/vezRcE=; b=qBtkp1J2CFcfLcaJ8ytJnVO2ON6RLsy9fCtCaeE78NePMCNhLIlWFeF+gce1LaTuqqAiol Fq3+itEC5czFjznFa1D52MCaefIPHM/FsQeh05SqTJ2+ofhcbPre44KemNxn68I4tCt8yh URQcnLNXGOjaIjr9QHvEWqTbQP2ILg45SLUhYMYMLxHxvWNnuKpujyaBL5G/8SiL2GroHJ AqmVZ34laeQNE30kOgHsNWypiZLXfO72WQs4+GE/5P0VQxsZH1gMJ5t3EwEo8CjIfcEBLF sNqThevH2DpxzpcRTvO4tone75ncuAt3Jtoihq1kSAPFT5yXv0oBpPdPbqvr0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715693964; a=rsa-sha256; cv=none; b=VdN+K2Az8dGkkkKuZJekcnM6Wjp8UTT7rF5vcLMYe+iYtYTluCEgBPTA1p/Kd4OI4/BITw mb1KDEwbovVmIU0ThUCwoWxSxyl4wcdsQifANmRBshmDmxrrTRblguIIQllqgd405cHT0P Sb+K8vjfnVMXdOr22YOPx7z4r4ZjCLL5gFxXwO1RDlIxZQgs2hMC2NFB0ttx3tIgKjVlTH nfDynQDsanVpdptILKKYSu3yalDt1OWhZc5TQ19poydQdDy+SzARYxg7dpOBTV0R7293Qg RhT0q1Mh6z9LyZycZtcSp8Z35RJutF0ZEe5ROZJ0AnQ7Ad7lBD4UpJJAG5f9JA== 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=1715693964; 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=nHJ6TvibdUoBsFQZ7x3la0iCF8NToTz/W/b8/vezRcE=; b=QeCjL2yhX2JJ6V3w9OE/AILp7sapjYQSY+wJl5QtjBlSIJ7dq8Vmg7IH+YSJhAShd/k8S/ 9h6eHBhe12h1v0Thd2W+cLkRtITjSMByJliTgRXIgqI2lXNAm1G7m+QXAQxnVmBf4/Qz5V mPF4ixc7AWMBknzEbr1d22cxsNVoIyf2ygROcdEuQ4HxNM4pmExBWJcgrdKJtVp33dUn6m NJ0Kg1fFOxzFyuIcuS6oK/IapOVENY3I4x+zuDeDlevl++lLbLnQm8T7f8d4LItB/4U1u7 dF0ZCXr8FzpyLn1GHcdcXHQWywB/BjwTX3taCEdrRbHTt8ofmwfLpvwzzQFUSQ== 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 4VdyBh5hzkzZ9B; Tue, 14 May 2024 13:39:24 +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 44EDdOtl080449; Tue, 14 May 2024 13:39:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EDdO7c080446; Tue, 14 May 2024 13:39:24 GMT (envelope-from git) Date: Tue, 14 May 2024 13:39:24 GMT Message-Id: <202405141339.44EDdO7c080446@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: 8bd89740cb2b - releng/14.1 - 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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 8bd89740cb2bb52ebe4155ed380c623e703c392f Auto-Submitted: auto-generated The branch releng/14.1 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8bd89740cb2bb52ebe4155ed380c623e703c392f commit 8bd89740cb2bb52ebe4155ed380c623e703c392f Author: Olivier Certner AuthorDate: 2024-02-22 08:53:51 +0000 Commit: Olivier Certner CommitDate: 2024-05-14 13:37:26 +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) (cherry picked from commit f9e9c02241dc887244cf62136dfcea04718290a0) Approved by: emaste (mentor) Approved by: re (cperciva) --- 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;