[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176762847139.510.9715015412455701988.tip-bot2@tip-bot2>
Date: Mon, 05 Jan 2026 15:54:31 -0000
From: "tip-bot2 for Marco Elver" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Marco Elver <elver@...gle.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Bart Van Assche <bvanassche@....org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: locking/core] kref: Add context-analysis annotations
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 5e256db9325e75e9f000ddd64e4f1dbd2a6d8acd
Gitweb: https://git.kernel.org/tip/5e256db9325e75e9f000ddd64e4f1dbd2a6d8acd
Author: Marco Elver <elver@...gle.com>
AuthorDate: Fri, 19 Dec 2025 16:40:05 +01:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Mon, 05 Jan 2026 16:43:31 +01:00
kref: Add context-analysis annotations
Mark functions that conditionally acquire the passed lock.
Signed-off-by: Marco Elver <elver@...gle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Bart Van Assche <bvanassche@....org>
Link: https://patch.msgid.link/20251219154418.3592607-17-elver@google.com
---
include/linux/kref.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/kref.h b/include/linux/kref.h
index 88e82ab..9bc6abe 100644
--- a/include/linux/kref.h
+++ b/include/linux/kref.h
@@ -81,6 +81,7 @@ static inline int kref_put(struct kref *kref, void (*release)(struct kref *kref)
static inline int kref_put_mutex(struct kref *kref,
void (*release)(struct kref *kref),
struct mutex *mutex)
+ __cond_acquires(true, mutex)
{
if (refcount_dec_and_mutex_lock(&kref->refcount, mutex)) {
release(kref);
@@ -102,6 +103,7 @@ static inline int kref_put_mutex(struct kref *kref,
static inline int kref_put_lock(struct kref *kref,
void (*release)(struct kref *kref),
spinlock_t *lock)
+ __cond_acquires(true, lock)
{
if (refcount_dec_and_lock(&kref->refcount, lock)) {
release(kref);
Powered by blists - more mailing lists