From nobody Tue Feb 27 09:00:17 2024 X-Original-To: dev-commits-src-main@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 4TkWf93vjXz5CmYR; Tue, 27 Feb 2024 09:00:17 +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 4TkWf93Pl4z4hVC; Tue, 27 Feb 2024 09:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709024417; 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=KrlR3s/KK3vzt4AWHNJuf3b3N+QYmGtrtjv5+bSSmGg=; b=PZWDBXH/BNxPdkTgPdPWxqQxk7Svy2P0aAj9MlLZgHcfeFG79mCK5mawb3G5aj9xySFEec IzEmz90VQlhL8u7WvIJbflBr37MlxWK/Rn1G5O3BMneS1AkreNPMlHrWqQNGMCNmGPSjkf EA9N+X6ozmo/E+yAUpiG5JHV6zSKjdn2wHyCy+GckcJSf9cGaSPWdpf3BMSgw8e6Llpp9w ZD0L6SdHKWVmBHfvNiLviO9IGji/om/W1LRSxgQynYZh5+S2UJR3pMBKchbhF/pf/vH0hx Ui3Ntrnn1kB67zCAIYpEavnU6A01hzG11R5gcQBg1aQtPPFNnRNtbuXNszOKGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709024417; a=rsa-sha256; cv=none; b=wj7MvAsv+o6e44bTcdVWGn5TEtOcNS0U1biTXGUB8RpSA4y6T69u/pYfp1YOpr6eiuBU0m ylc1Upafzz5s9iZ4+N/QOfuZlt7fFomJxPEf6yCF/EtO3MzxKuzjtADvZG5/OfgtA/w0Q6 Umn+5ipQw5Jkf+vCvmSvawMcLnHVPXnmATCUfsBf/ZBHFxS1QQkVEyJ2Fv6vIRbX8rpqaA Q4eN3gKtwOcoByMXw38YDN3uHbztK6YZfl8Oe4dCofao4dOki9KMxT4WwlOFB02CznpoaX BtCGme5Pjyo0NPn68nB9HVoYFFdAeVIWxSSaL7h3LjPwU6eW8EunKmpnsybuCw== 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=1709024417; 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=KrlR3s/KK3vzt4AWHNJuf3b3N+QYmGtrtjv5+bSSmGg=; b=H3w+SlJBo1XdTXrj6By2px7pappTfnQMODALLNOfixJn8NrzNv6L8CxrKpt/O/oNf5KjMN x76wMXa6NenWZWj4uIuwL0zuDCKcRh2MHmI05YlehGzBKcNMNLT7Y0aX904yoxL3IXopM8 vH4q6/ITOQ/eZPjM9CRy3fAtjP6bIoPcBgrq6czlXe4uWyPzK1O5rBdjT5AUB0ZWUT2UwH 59ZPASk8PN8QJl7O3WZ0rjInptuiooukeoE+bXvrR5cdOZBXkIG+IF13XO4OquRLpOvdw6 kO7ZA+yN4nX2mHsAOBOIaaQSIwcZ3WzNXQpTnwm+vTk0m+KAfY0xoU5AdLAXDg== 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 4TkWf92S9Rz154g; Tue, 27 Feb 2024 09:00:17 +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 41R90Hcu004021; Tue, 27 Feb 2024 09:00:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41R90HbS004016; Tue, 27 Feb 2024 09:00:17 GMT (envelope-from git) Date: Tue, 27 Feb 2024 09:00:17 GMT Message-Id: <202402270900.41R90HbS004016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 9ac3ac9ece62 - main - PP mutexes: lock: Check if priority is too high against base one List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 9ac3ac9ece6269365ac314fa5fdb484e96d4a32e Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9ac3ac9ece6269365ac314fa5fdb484e96d4a32e commit 9ac3ac9ece6269365ac314fa5fdb484e96d4a32e Author: Olivier Certner AuthorDate: 2024-02-22 08:53:51 +0000 Commit: Olivier Certner CommitDate: 2024-02-27 08:59:36 +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 --- 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;