summaryrefslogtreecommitdiff
path: root/kernel/locking
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2026-08-04 07:15:44 +0000
committerPeter Zijlstra <peterz@infradead.org>2026-08-07 17:58:10 +0200
commitb359800c6970cb653d41ed2af18fd8e95dbb822f (patch)
treeeeb7f6dc911982d69ab277296faec8fdaee8043f /kernel/locking
parentf7e2cb6d495aa1a88368650970a230b45870859b (diff)
downloadlinux-next-b359800c6970cb653d41ed2af18fd8e95dbb822f.tar.gz
linux-next-b359800c6970cb653d41ed2af18fd8e95dbb822f.zip
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 <d@ilvokhin.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Juergen Gross <jgross@suse.com> Link: https://patch.msgid.link/1c2fcccfb584c075c02890c484f22c76a1948bf1.1785778551.git.d@ilvokhin.com
Diffstat (limited to 'kernel/locking')
-rw-r--r--kernel/locking/mutex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 8a85912d7ee6..942a939cee95 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);
+__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