Question about RCU

contemplating zombie contemplatingzombie at gmail.com
Sat Dec 17 19:15:30 EST 2011


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111217/7520f337/attachment.html 


More information about the Kernelnewbies mailing list