From nobody Thu May 09 13:30:19 2024 X-Original-To: dev-commits-src-branches@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 4VZtDX2xZ2z5JgtB; Thu, 09 May 2024 13:30:20 +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 4VZtDW6WpFz3xyK; Thu, 9 May 2024 13:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261419; 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=FmpBZLIwT3282glhNJ9+NXDjAq+dSYpE83lpEN8DQ6U=; b=l/xxhEqWaLZmXnp1HtiXwnVSMwsVM6kP85b0lsJvNTHD9FyVdEOCdLzw9J0A5qJKNrV/cY 2++2lEK0TtrAqhLruTvwwERBODpS5xOLsMe4fyIqBwCmNLDsx69f5lMn3tNKZRioG6DNJE k1pJHpkbYIAPnTVFYOF8b3dPaGPquKZm6UasOAYacBbOFgRY8NnzBKEivEbrU7B4deyS/i kbBkAm+JTCXbeIJXKH5ZZHQnVgzwW7kxwHm2Q1VCPeJHef0nQJYmG2z8E+Z61AnRxGYqqC u3vaFkmaGTGX+vl4Fv6YbRlSyvBLymDXkQjD3gHCIGUPe+2QpcZLFHdEXUGKIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261419; a=rsa-sha256; cv=none; b=wWSFkUSjmTSv7ekrE16Vjcr6DBDkt8ekCbSVvTXY4cKwDeR1jml8ZXroCi/1HRglc0YQ3k gXACZOLMaoBsjVOIZ4QndB13uXo5de6K7u8ASMhtr+UDWMLjyN2LtXARBc5f6EEKk5razB I7dyKH4EXqHwueZlFHHN2NRh625+sV+K2VizAGS2ZCi+Bp5JZuSX8A6TRugzxkyYBCU/yK J6yY/bauv0Hw/8hg/p9kRZxMgSKLAAevkBfc9NCfZ/lMYOEq/s/pd4UBt4+EiJo2EctMZE F9Ipde5mqYsPLQQQBqTWE5754UuUwWrhqSlxRrYpshLa6bw+O0hw6uuwpaMySA== 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=1715261419; 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=FmpBZLIwT3282glhNJ9+NXDjAq+dSYpE83lpEN8DQ6U=; b=EeZt6CcoRPWfKNWxegZul+UNomHqKav/0FPRgkb6y3V0L+f9pqbjGEg+jdVrQsjpL497y1 9tJcEHfga2v9qYhGY7l8ggqVuImI2j58IfAr8Z8raV7PExxgIrg5jqo5TrNDR4GqkstGXA 83k9eFNsScziO4fU4ICTKMJGjoygpyroz/l9OPtDORdmqOHIFS/pUHOSJ2Xqre8HBKgdpC x4+4V0n8krV8rYxxJ2abtRFCazW7T/Q+De9kHMoIgxoJK6dwBupDxwRTUlB5GrUdGUiLax 3FlgAnZfYAX9jN3ib3+dtB7ToPKRhoqw/8A/PXpdTaObWhaG5ARCcTQrvS8zuw== 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 4VZtDW4DsCz19Ld; Thu, 9 May 2024 13:30:19 +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 449DUJk6058900; Thu, 9 May 2024 13:30:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DUJfJ058897; Thu, 9 May 2024 13:30:19 GMT (envelope-from git) Date: Thu, 9 May 2024 13:30:19 GMT Message-Id: <202405091330.449DUJfJ058897@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: f5a145cb0a5f - stable/13 - PP mutexes: lock: Check if priority is too high against base one List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: f5a145cb0a5f5ca0eef54d35d60f765639c8f30a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f5a145cb0a5f5ca0eef54d35d60f765639c8f30a commit f5a145cb0a5f5ca0eef54d35d60f765639c8f30a Author: Olivier Certner AuthorDate: 2024-02-22 08:53:51 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:29:18 +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 5767a137b536..05a47f405d30 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2552,7 +2552,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;