Thread (4 messages) 4 messages, 3 authors, 2025-09-13

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

From: Waiman Long <hidden>
Date: 2025-09-12 21:13:15
Also in: cgroups, intel-gfx, linux-acpi, linux-fsdevel, linux-nfs, linux-rt-devel, linux-s390, linux-security-module, lkml

On 9/12/25 2:50 AM, pengdonglin wrote:
From: pengdonglin <redacted>

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help