[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9d06c0d5-e20c-4069-adca-68a2c4cf6f4f@redhat.com>
Date: Fri, 12 Sep 2025 20:33:31 -0400
From: Waiman Long <llong@...hat.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Waiman Long <llong@...hat.com>
Cc: pengdonglin <dolinux.peng@...il.com>, tj@...nel.org, tony.luck@...el.com,
jani.nikula@...ux.intel.com, ap420073@...il.com, jv@...sburgh.net,
freude@...ux.ibm.com, bcrl@...ck.org, trondmy@...nel.org, kees@...nel.org,
linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev,
linux-nfs@...r.kernel.org, linux-aio@...ck.org,
linux-fsdevel@...r.kernel.org, linux-security-module@...r.kernel.org,
netdev@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
linux-acpi@...r.kernel.org, linux-s390@...r.kernel.org,
cgroups@...r.kernel.org, pengdonglin <pengdonglin@...omi.com>,
"Paul E . McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH] rcu: Remove redundant rcu_read_lock/unlock() in spin_lock
critical sections
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@...omi.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
Powered by blists - more mailing lists