All of lore.kernel.org
 help / color / mirror / Atom feed
* RCU read lock vs spinlocks
@ 2010-03-25 10:51 David Howells
  2010-03-26 16:39 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2010-03-25 10:51 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: dhowells, linux-arch


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

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

end of thread, other threads:[~2010-03-26 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 10:51 RCU read lock vs spinlocks David Howells
2010-03-26 16:39 ` Paul E. McKenney

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.