Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kref: Add context-analysis annotations

Mark functions that conditionally acquire the passed lock.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251219154418.3592607-17-elver@google.com

authored by

Marco Elver and committed by
Peter Zijlstra
5e256db9 f0b7ce22

+2
+2
include/linux/kref.h
··· 81 81 static inline int kref_put_mutex(struct kref *kref, 82 82 void (*release)(struct kref *kref), 83 83 struct mutex *mutex) 84 + __cond_acquires(true, mutex) 84 85 { 85 86 if (refcount_dec_and_mutex_lock(&kref->refcount, mutex)) { 86 87 release(kref); ··· 103 102 static inline int kref_put_lock(struct kref *kref, 104 103 void (*release)(struct kref *kref), 105 104 spinlock_t *lock) 105 + __cond_acquires(true, lock) 106 106 { 107 107 if (refcount_dec_and_lock(&kref->refcount, lock)) { 108 108 release(kref);