From: David Howells <dhowells@redhat.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: dhowells@redhat.com, linux-arch@vger.kernel.org
Subject: RCU read lock vs spinlocks
Date: Thu, 25 Mar 2010 10:51:55 +0000 [thread overview]
Message-ID: <29095.1269514315@redhat.com> (raw)
If a function needs both a spinlock and the RCU read lock, is there a best
order in which they should be taken? For instance, is:
spin_lock(&my_lock);
rcu_read_lock();
...
rcu_read_unlock();
spin_unlock(&my_lock);
better than:
rcu_read_lock();
spin_lock(&my_lock);
...
spin_unlock(&my_lock);
rcu_read_unlock();
And does it make any different if spin_lock_irq*() is used?
In fact, should spin_lock_irq*() imply rcu_read_lock()? Given that the
current task can't be preempted if there can be no interrupt to do the
preempting?
David
next reply other threads:[~2010-03-25 10:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 10:51 David Howells [this message]
2010-03-26 16:39 ` RCU read lock vs spinlocks Paul E. McKenney
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=29095.1269514315@redhat.com \
--to=dhowells@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.