Re: [PATCH] rcu: Remove redundant rcu_read_lock/unlock() in spin_lock critical sections

Waiman Long <[email protected]>
Newsgroups gmane.linux.kernel.aio.general,gmane.linux.kernel,gmane.linux.nfs,gmane.linux.file-systems,gmane.linux.kernel.lsm,gmane.linux.network,gmane.comp.freedesktop.xorg.drivers.intel,gmane.linux.acpi.devel,gmane.linux.kernel.cgroups
Message-ID <[email protected]>
On 9/12/25 2:50 AM, pengdonglin wrote:
> From: pengdonglin <[email protected]>
>
> 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.

When CONFIG_PREEMPT_RT is enabled, rt_spin_lock/unlock() will call 
rcu_read_lock/_unlock() internally. So eliminating explicit 
rcu_read_lock/unlock() in critical sections should be fine.

Cheers,
Longman


--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to [email protected].  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"[email protected]">[email protected]</a>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.