kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: contemplatingzombie@gmail.com (contemplating zombie)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Question about RCU
Date: Sat, 17 Dec 2011 19:15:30 -0500	[thread overview]
Message-ID: <CAO_gTC5ZGVoyMATX+ZSSHUpi9_knQ6xKdBDa94p7fwv2JrRcgA@mail.gmail.com> (raw)

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 

             reply	other threads:[~2011-12-18  0:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18  0:15 contemplating zombie [this message]
2011-12-21 18:51 ` Question about RCU Jonathan Neuschäfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAO_gTC5ZGVoyMATX+ZSSHUpi9_knQ6xKdBDa94p7fwv2JrRcgA@mail.gmail.com \
    --to=contemplatingzombie@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).