mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Dmitry Ilvokhin" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Dmitry Ilvokhin <d@ilvokhin.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/core] locking: Factor out queued_spin_release()
Date: Fri, 07 Aug 2026 16:00:04 -0000	[thread overview]
Message-ID: <178611840487.708.10386686607999550696.tip-bot2@tip-bot2> (raw)
In-Reply-To: <b8daabae6469ad72cc784a911f6cc43a6d45df3a.1785778551.git.d@ilvokhin.com>

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     216c6c67f7f1292474de1a3d1ae7d1cb95514264
Gitweb:        https://git.kernel.org/tip/216c6c67f7f1292474de1a3d1ae7d1cb95514264
Author:        Dmitry Ilvokhin <d@ilvokhin.com>
AuthorDate:    Tue, 04 Aug 2026 07:15:42 
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 07 Aug 2026 17:58:09 +02:00

locking: Factor out queued_spin_release()

The contended_release tracepoint needs to hook queued_spin_unlock(), but
architectures with a custom unlock define queued_spin_unlock() directly,
leaving no single generic place to add the tracing.

Introduce queued_spin_release() as the arch-overridable release
primitive and make queued_spin_unlock() a generic wrapper around it.
An architecture that only customizes the release can then override
queued_spin_release() and inherit the generic wrapper.

Rename the MIPS override to queued_spin_release() accordingly. x86
paravirt overrides queued_spin_unlock() directly and is left unchanged.

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/b8daabae6469ad72cc784a911f6cc43a6d45df3a.1785778551.git.d@ilvokhin.com
---
 arch/mips/include/asm/spinlock.h |  6 +++---
 include/asm-generic/qspinlock.h  | 17 ++++++++++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
index 6ce2117..c349162 100644
--- a/arch/mips/include/asm/spinlock.h
+++ b/arch/mips/include/asm/spinlock.h
@@ -13,12 +13,12 @@
 
 #include <asm-generic/qspinlock_types.h>
 
-#define	queued_spin_unlock queued_spin_unlock
+#define	queued_spin_release queued_spin_release
 /**
- * queued_spin_unlock - release a queued spinlock
+ * queued_spin_release - release a queued spinlock
  * @lock : Pointer to queued spinlock structure
  */
-static inline void queued_spin_unlock(struct qspinlock *lock)
+static inline void queued_spin_release(struct qspinlock *lock)
 {
 	/* This could be optimised with ARCH_HAS_MMIOWB */
 	mmiowb();
diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h
index bf47cca..ae45289 100644
--- a/include/asm-generic/qspinlock.h
+++ b/include/asm-generic/qspinlock.h
@@ -115,12 +115,12 @@ static __always_inline void queued_spin_lock(struct qspinlock *lock)
 }
 #endif
 
-#ifndef queued_spin_unlock
+#ifndef queued_spin_release
 /**
- * queued_spin_unlock - release a queued spinlock
+ * queued_spin_release - release a queued spinlock
  * @lock : Pointer to queued spinlock structure
  */
-static __always_inline void queued_spin_unlock(struct qspinlock *lock)
+static __always_inline void queued_spin_release(struct qspinlock *lock)
 {
 	/*
 	 * unlock() needs release semantics:
@@ -129,6 +129,17 @@ static __always_inline void queued_spin_unlock(struct qspinlock *lock)
 }
 #endif
 
+#ifndef queued_spin_unlock
+/**
+ * queued_spin_unlock - unlock a queued spinlock
+ * @lock : Pointer to queued spinlock structure
+ */
+static __always_inline void queued_spin_unlock(struct qspinlock *lock)
+{
+	queued_spin_release(lock);
+}
+#endif
+
 #ifndef virt_spin_lock
 static __always_inline bool virt_spin_lock(struct qspinlock *lock)
 {

  reply	other threads:[~2026-08-07 16:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  7:15 [PATCH 0/5] locking/qspinlock: Add contended_release tracepoint Dmitry Ilvokhin
2026-08-04  7:15 ` [PATCH 1/5] x86/paravirt: Use static_call() for the paravirt spinlock ops Dmitry Ilvokhin
2026-08-04 19:00   ` Borislav Petkov
2026-08-04 19:54     ` Peter Zijlstra
2026-08-07 16:00   ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2026-08-04  7:15 ` [PATCH 2/5] locking: Factor out queued_spin_release() Dmitry Ilvokhin
2026-08-07 16:00   ` tip-bot2 for Dmitry Ilvokhin [this message]
2026-08-04  7:15 ` [PATCH 3/5] locking/qspinlock: Add contended_release tracepoint Dmitry Ilvokhin
2026-08-07 16:00   ` [tip: locking/core] " tip-bot2 for Dmitry Ilvokhin
2026-08-04  7:15 ` [PATCH 4/5] tracing/lock: Use TRACE_EVENT_FN() for contended_release Dmitry Ilvokhin
2026-08-07 16:00   ` [tip: locking/core] " tip-bot2 for Dmitry Ilvokhin
2026-08-04  7:15 ` [PATCH 5/5] x86/paravirt: Trace contended_release on unlock Dmitry Ilvokhin
2026-08-07 15:59   ` [tip: locking/core] " tip-bot2 for Dmitry Ilvokhin
2026-08-04  7:57 ` [PATCH 0/5] locking/qspinlock: Add contended_release tracepoint Juergen Gross
2026-08-04 10:39 ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178611840487.708.10386686607999550696.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=d@ilvokhin.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®