kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Question about RCU
@ 2011-12-18  0:15 contemplating zombie
  2011-12-21 18:51 ` Jonathan Neuschäfer
  0 siblings, 1 reply; 2+ messages in thread
From: contemplating zombie @ 2011-12-18  0:15 UTC (permalink / raw)
  To: kernelnewbies

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 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Question about RCU
  2011-12-18  0:15 Question about RCU contemplating zombie
@ 2011-12-21 18:51 ` Jonathan Neuschäfer
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Neuschäfer @ 2011-12-21 18:51 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-21 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-18  0:15 Question about RCU contemplating zombie
2011-12-21 18:51 ` Jonathan Neuschäfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).