LKML Archive on
help / color / mirror / Atom feed
From: "Zhang, Qiang" <>
To: Sebastian Andrzej Siewior <>
Cc: "" <>,
	LKML <>,
	Thomas Gleixner <>
Subject: Question on (locking: Make spinlock_t and rwlock_t a RCU section on RT)
Date: Mon, 26 Jul 2021 07:43:33 +0000	[thread overview]
Message-ID: <> (raw)

Hello,  I have some questions about this patch 

From: Sebastian Andrzej Siewior <>
Date: Tue, 19 Nov 2019 09:25:04 +0100
Subject: [PATCH] locking: Make spinlock_t and rwlock_t a RCU section on RT

On !RT a locked spinlock_t and rwlock_t disables preemption which
implies a RCU read section. There is code that relies on that behaviour.

Add an explicit RCU read section on RT while a sleeping lock (a lock
which would disables preemption on !RT) acquired.

Signed-off-by: Sebastian Andrzej Siewior <>
 kernel/locking/rtmutex.c   |    6 ++++++
 kernel/locking/rwlock-rt.c |    6 ++++++
 2 files changed, 12 insertions(+)

--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1136,6 +1136,7 @@ void __lockfunc rt_spin_lock(spinlock_t
        spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock);
+       rcu_read_lock();

Operation of sleep is not allowed in RCU read critical area,  If  after acquiring a rt-spinlock , try to acquire another one rt-spinlock,  This may cause sleep, and trigger RCU warning.  

Is there a problem with my analysis or something I missed?


             reply	other threads:[~2021-07-26  7:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26  7:43 Zhang, Qiang [this message]
2021-07-30 14:44 ` 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:

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

  git send-email \ \ \ \ \ \ \
    --subject='Re: Question on (locking: Make spinlock_t and rwlock_t a RCU section on RT)' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).