From: "tip-bot2 for Sebastian Andrzej Siewior" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/core] locking/rt: Add sparse annotation PREEMPT_RT's sleeping locks.
Date: Thu, 24 Oct 2024 09:37:07 -0000 [thread overview]
Message-ID: <172976262776.1442.16420209741219015912.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240812104200.2239232-2-bigeasy@linutronix.de>
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 52e0874fc16bd26e9ea1871e30ffb2c6dff187cf
Gitweb: https://git.kernel.org/tip/52e0874fc16bd26e9ea1871e30ffb2c6dff187cf
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Mon, 12 Aug 2024 12:39:02 +02:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 24 Oct 2024 11:27:01 +02:00
locking/rt: Add sparse annotation PREEMPT_RT's sleeping locks.
The sleeping locks on PREEMPT_RT (rt_spin_lock() and friends) lack
sparse annotation. Therefore a missing spin_unlock() won't be spotted by
sparse in a PREEMPT_RT build while it is noticed on a !PREEMPT_RT build.
Add the __acquires/__releases macros to the lock/ unlock functions. The
trylock functions already use the __cond_lock() wrapper.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240812104200.2239232-2-bigeasy@linutronix.de
---
include/linux/rwlock_rt.h | 10 +++++-----
include/linux/spinlock_rt.h | 8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/linux/rwlock_rt.h b/include/linux/rwlock_rt.h
index 8544ff0..7d81fc6 100644
--- a/include/linux/rwlock_rt.h
+++ b/include/linux/rwlock_rt.h
@@ -24,13 +24,13 @@ do { \
__rt_rwlock_init(rwl, #rwl, &__key); \
} while (0)
-extern void rt_read_lock(rwlock_t *rwlock);
+extern void rt_read_lock(rwlock_t *rwlock) __acquires(rwlock);
extern int rt_read_trylock(rwlock_t *rwlock);
-extern void rt_read_unlock(rwlock_t *rwlock);
-extern void rt_write_lock(rwlock_t *rwlock);
-extern void rt_write_lock_nested(rwlock_t *rwlock, int subclass);
+extern void rt_read_unlock(rwlock_t *rwlock) __releases(rwlock);
+extern void rt_write_lock(rwlock_t *rwlock) __acquires(rwlock);
+extern void rt_write_lock_nested(rwlock_t *rwlock, int subclass) __acquires(rwlock);
extern int rt_write_trylock(rwlock_t *rwlock);
-extern void rt_write_unlock(rwlock_t *rwlock);
+extern void rt_write_unlock(rwlock_t *rwlock) __releases(rwlock);
static __always_inline void read_lock(rwlock_t *rwlock)
{
diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h
index 61c49b1..babc3e0 100644
--- a/include/linux/spinlock_rt.h
+++ b/include/linux/spinlock_rt.h
@@ -32,10 +32,10 @@ do { \
__rt_spin_lock_init(slock, #slock, &__key, true); \
} while (0)
-extern void rt_spin_lock(spinlock_t *lock);
-extern void rt_spin_lock_nested(spinlock_t *lock, int subclass);
-extern void rt_spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *nest_lock);
-extern void rt_spin_unlock(spinlock_t *lock);
+extern void rt_spin_lock(spinlock_t *lock) __acquires(lock);
+extern void rt_spin_lock_nested(spinlock_t *lock, int subclass) __acquires(lock);
+extern void rt_spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *nest_lock) __acquires(lock);
+extern void rt_spin_unlock(spinlock_t *lock) __releases(lock);
extern void rt_spin_lock_unlock(spinlock_t *lock);
extern int rt_spin_trylock_bh(spinlock_t *lock);
extern int rt_spin_trylock(spinlock_t *lock);
next prev parent reply other threads:[~2024-10-24 9:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 10:39 [PATCH 0/4] locking/rt: Add sparse annotation PREEMPT_RT's locking Sebastian Andrzej Siewior
2024-08-12 10:39 ` [PATCH 1/4] locking/rt: Add sparse annotation PREEMPT_RT's sleeping locks Sebastian Andrzej Siewior
2024-10-24 9:37 ` tip-bot2 for Sebastian Andrzej Siewior [this message]
2024-08-12 10:39 ` [PATCH 2/4] locking/rt: Remove one __cond_lock() in RT's spin_trylock_irqsave() Sebastian Andrzej Siewior
2024-10-24 9:37 ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
2024-08-12 10:39 ` [PATCH 3/4] locking/rt: Add sparse annotation for RCU Sebastian Andrzej Siewior
2024-10-24 9:37 ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
2024-08-12 10:39 ` [PATCH 4/4] locking/rt: Annotate unlock followed by lock for sparse Sebastian Andrzej Siewior
2024-10-24 9:37 ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
2024-10-01 7:17 ` [PATCH 0/4] locking/rt: Add sparse annotation PREEMPT_RT's locking Sebastian Andrzej Siewior
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=172976262776.1442.16420209741219015912.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--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®