From: Waiman Long <llong@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Waiman Long <llong@redhat.com>
Cc: pengdonglin <dolinux.peng@gmail.com>,
tj@kernel.org, tony.luck@intel.com, jani.nikula@linux.intel.com,
ap420073@gmail.com, jv@jvosburgh.net, freude@linux.ibm.com,
bcrl@kvack.org, trondmy@kernel.org, kees@kernel.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev,
linux-nfs@vger.kernel.org, linux-aio@kvack.org,
linux-fsdevel@vger.kernel.org,
linux-security-module@vger.kernel.org, netdev@vger.kernel.org,
intel-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org,
linux-s390@vger.kernel.org, cgroups@vger.kernel.org,
pengdonglin <pengdonglin@xiaomi.com>,
"Paul E . McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH] rcu: Remove redundant rcu_read_lock/unlock() in spin_lock critical sections
Date: Fri, 12 Sep 2025 20:33:31 -0400 [thread overview]
Message-ID: <9d06c0d5-e20c-4069-adca-68a2c4cf6f4f@redhat.com> (raw)
In-Reply-To: <20250912213531.7-YeRBeD@linutronix.de>
On 9/12/25 5:35 PM, Sebastian Andrzej Siewior wrote:
> On 2025-09-12 17:13:09 [-0400], Waiman Long wrote:
>> On 9/12/25 2:50 AM, pengdonglin wrote:
>>> From: pengdonglin <pengdonglin@xiaomi.com>
>>>
>>> When CONFIG_PREEMPT_RT is disabled, spin_lock*() operations implicitly
>>> disable preemption, which provides RCU read-side protection. When
>>> CONFIG_PREEMPT_RT is enabled, spin_lock*() implementations internally
>>> manage RCU read-side critical sections.
>> I have some doubt about your claim that disabling preemption provides RCU
>> read-side protection. It is true for some flavors but probably not all. I do
>> know that disabling interrupt will provide RCU read-side protection. So for
>> spin_lock_irq*() calls, that is valid. I am not sure about spin_lock_bh(),
>> maybe it applies there too. we need some RCU people to confirm.
> The claim is valid since Paul merged the three flavours we had. Before
> that preempt_disable() (and disabling irqs) would match
> rcu_read_lock_sched(). rcu_read_lock() and rcu_read_lock_bh() were
> different in terms of grace period and clean up.
> So _now_ we could remove it if it makes things easier.
Thanks for the clarification.
In this case, I think the patch description should mention the commit
that unify the 3 RCU flavors to make sure that this patch won't be
accidentally backport'ed to an older kernel without the necessary
prerequisite commit(s).
Cheers,
Longman
prev parent reply other threads:[~2025-09-13 0:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 6:50 [PATCH] rcu: Remove redundant rcu_read_lock/unlock() in spin_lock critical sections pengdonglin
2025-09-12 21:13 ` Waiman Long
2025-09-12 21:35 ` Sebastian Andrzej Siewior
2025-09-13 0:33 ` Waiman Long [this message]
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=9d06c0d5-e20c-4069-adca-68a2c4cf6f4f@redhat.com \
--to=llong@redhat.com \
--cc=ap420073@gmail.com \
--cc=bcrl@kvack.org \
--cc=bigeasy@linutronix.de \
--cc=cgroups@vger.kernel.org \
--cc=dolinux.peng@gmail.com \
--cc=freude@linux.ibm.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jv@jvosburgh.net \
--cc=kees@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux-s390@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=pengdonglin@xiaomi.com \
--cc=tj@kernel.org \
--cc=tony.luck@intel.com \
--cc=trondmy@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;
as well as URLs for NNTP newsgroup(s).