Question about RCU
Hi, I understand that multiple readers have to use rcu_read_lock(void) and rcu_read_unlock(void) to read data protected by rcu. However, I do not understand how the kernel distinguishes between multiple rcu protected regions. For e.g. if a region/data is protected by a mutex or spinlock, then the code is something like: int data; mutex_t/spinlock_t lock; print_data() { acquire(lock); release(lock); } Here kernel can distinguish between different regions/data using different locks used to protect it. However, the rcu_read(un)lock() do not accept any lock as a parameter. How does it manage under the hood? -Thanks.
On Sat, Dec 17, 2011 at 07:15:30PM -0500, contemplating zombie wrote:
Hi,
I understand that multiple readers have to use rcu_read_lock(void) and rcu_read_unlock(void) to read data protected by rcu. However, I do not understand how the kernel distinguishes between multiple rcu protected regions.
It doesn't. Have you read Documentation/RCU/whatisRCU.txt? Thanks, Jonathan Neuschäfer
participants (2)
-
contemplating zombie -
Jonathan Neuschäfer