[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87wnopbwgo.ffs@tglx>
Date: Fri, 13 Aug 2021 10:05:59 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Juri Lelli <juri.lelli@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Davidlohr Bueso <dave@...olabs.net>,
Mike Galbraith <efault@....de>
Subject: [patch V4 69/68] locking/rt: Add missing __might_sleep() to
spin/rwlocks
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
On RT enabled kernels the substituted spin_lock and rw_lock acquisition
functions can sleep.
Add the missing __might_sleep() invocations.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
V4+: This should have been part of the V4 submission, but got lost
during patch juggling.
---
kernel/locking/spinlock_rt.c | 3 +++
1 file changed, 3 insertions(+)
---
--- a/kernel/locking/spinlock_rt.c
+++ b/kernel/locking/spinlock_rt.c
@@ -32,6 +32,7 @@ static __always_inline void rtlock_lock(
static __always_inline void __rt_spin_lock(spinlock_t *lock)
{
+ ___might_sleep(__FILE__, __LINE__, 0);
rtlock_lock(&lock->lock);
rcu_read_lock();
migrate_disable();
@@ -206,6 +207,7 @@ EXPORT_SYMBOL(rt_write_trylock);
void __sched rt_read_lock(rwlock_t *rwlock)
{
+ ___might_sleep(__FILE__, __LINE__, 0);
rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_);
rwbase_read_lock(&rwlock->rwbase, TASK_RTLOCK_WAIT);
rcu_read_lock();
@@ -215,6 +217,7 @@ EXPORT_SYMBOL(rt_read_lock);
void __sched rt_write_lock(rwlock_t *rwlock)
{
+ ___might_sleep(__FILE__, __LINE__, 0);
rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_);
rwbase_write_lock(&rwlock->rwbase, TASK_RTLOCK_WAIT);
rcu_read_lock();
Powered by blists - more mailing lists