From nobody Tue Sep 29 12:02:15 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9AFB374195; Fri, 7 Aug 2026 16:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786118406; cv=none; b=QwVi5EzEMOrJR4s8X4s1xlLwMbZEvqCZoPHXUbp1azulu+7jzqeoyQSTASIVciWoseZiYpSJoK+KD6/6WrtffWklWtOiXYYKD6eKpXq8es6L6dRrCvEBz2B1jaURVfOAxAA3To4wlBgClGuWW3GRMuOtEAcwQRDcS8SgqJnQ5pM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786118406; c=relaxed/simple; bh=AdtkdutrobiL9JTdUUuHrwKFGZPfDLQP/8AIo37M3c8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=IAiPy9VG4m5+Vr4HNDBZd/2tJf9ovPbLRdtYOvr1hjAV6oV1lVQhj9IT1YSKsigjyVRH26qkrtbNFgpJjqmIeAXbwTUR6D093y0HAbRN932fpxbw4hfx95joO8uxR2KG81s2oSs5tt1QiHaSjcgicrWzgcoU6VIMav/MlMJi05o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Cv8FxP25; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7IytVd4t; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Cv8FxP25"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7IytVd4t" Date: Fri, 07 Aug 2026 16:00:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1786118403; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ONbLqWvYzs5n/lA30NdXMCNzpgzCNwuPPCOmgi7mFow=; b=Cv8FxP25UdvRwtBYNEr5XbqOMUrBs73nXkpRDQMirAl87ZSnHVdOuj3ZBH4dkgZcUNt2F+ Ta809helEdf9+8sGpKA0+uXCH7uhS9EnrrEWehhjlyOfsl1kczgkI/iuD2IZFBzqMa7+fN iVR0wUomiLGeemoSq11qFh6kQKAUHKxQIko/9n6h9K8hQMBj2uStLNIe4ecDm9XWy+hqA4 +6Eu8WUrU4G/7RXKeAvYtBfIEZyTrKDumFhBUcXvPgara8DQ8wJINemGKh1t5+hgnTHMci e99e+tzaEoqDu9X+7fQi611L54ZH1Tu7pClcAL31kPJJyK2jFpYiN8+WSP1qFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1786118403; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ONbLqWvYzs5n/lA30NdXMCNzpgzCNwuPPCOmgi7mFow=; b=7IytVd4thSYY1Ljt+0RaxOmsfRZcc3cK+2axnDhWuQWdrG2PZ+YI381dTgwdOmo2q9DM0p KPGH5oLpvZVDpmBA== From: "tip-bot2 for Dmitry Ilvokhin" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] tracing/lock: Use TRACE_EVENT_FN() for contended_release Cc: Dmitry Ilvokhin , "Peter Zijlstra (Intel)" , Juergen Gross , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1c2fcccfb584c075c02890c484f22c76a1948bf1.1785778551.git.d@ilvokhin.com> References: <1c2fcccfb584c075c02890c484f22c76a1948bf1.1785778551.git.d@ilvokhin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178611840140.708.15748718455913667581.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the locking/core branch of tip: Commit-ID: b359800c6970cb653d41ed2af18fd8e95dbb822f Gitweb: https://git.kernel.org/tip/b359800c6970cb653d41ed2af18fd8e95= dbb822f Author: Dmitry Ilvokhin AuthorDate: Tue, 04 Aug 2026 07:15:44=20 Committer: Peter Zijlstra CommitterDate: Fri, 07 Aug 2026 17:58:10 +02:00 tracing/lock: Use TRACE_EVENT_FN() for contended_release queued_spin_unlock() gates its contended_release trace call behind a static branch, so a NOP sits on the unlock path even while the tracepoint is disabled. Removing that requires replacing the unlock implementation only while contended_release is enabled, which needs a callback when the tracepoint is toggled. Convert contended_release to TRACE_EVENT_FN() and add weak no-op arch_contended_release_trace_reg()/arch_contended_release_trace_unreg() hooks. The default hooks are empty, so this is a no-op until an architecture overrides them. No functional change intended. Signed-off-by: Dmitry Ilvokhin Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juergen Gross Link: https://patch.msgid.link/1c2fcccfb584c075c02890c484f22c76a1948bf1.178= 5778551.git.d@ilvokhin.com --- include/trace/events/lock.h | 10 ++++++++-- kernel/locking/mutex.c | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h index 1ded869..b1d5b18 100644 --- a/include/trace/events/lock.h +++ b/include/trace/events/lock.h @@ -137,7 +137,11 @@ TRACE_EVENT(contention_end, TP_printk("%p (ret=3D%d)", __entry->lock_addr, __entry->ret) ); =20 -TRACE_EVENT(contended_release, +/* kernel/locking/mutex.c */ +int arch_contended_release_trace_reg(void); +void arch_contended_release_trace_unreg(void); + +TRACE_EVENT_FN(contended_release, =20 TP_PROTO(void *lock), =20 @@ -151,7 +155,9 @@ TRACE_EVENT(contended_release, __entry->lock_addr =3D lock; ), =20 - TP_printk("%p", __entry->lock_addr) + TP_printk("%p", __entry->lock_addr), + + arch_contended_release_trace_reg, arch_contended_release_trace_unreg ); =20 #endif /* _TRACE_LOCK_H */ diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c index 8a85912..942a939 100644 --- a/kernel/locking/mutex.c +++ b/kernel/locking/mutex.c @@ -1272,6 +1272,10 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(contention_begin); EXPORT_TRACEPOINT_SYMBOL_GPL(contention_end); EXPORT_TRACEPOINT_SYMBOL_GPL(contended_release); =20 +__weak int arch_contended_release_trace_reg(void) { return 0; } + +__weak void arch_contended_release_trace_unreg(void) { } + /** * atomic_dec_and_mutex_lock - return holding mutex if we dec to 0 * @cnt: the atomic which we are to dec