public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Using RCU with rcu_read_lock()?
@ 2007-06-15 19:00 Dmitry Torokhov
  2007-06-15 19:04 ` Peter Zijlstra
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2007-06-15 19:00 UTC (permalink / raw)
  To: LKML, Paul E. McKenney

Hi,

I have a piece of code that is always called under a spinlock with
interrups disabled. Within that piece of code I iterate through a
list. I have another piece of code that wants to modify that list. I
have 2 options:

1) Have the other piece of code acquire the same spinlock
2) Use RCU

I don't want to do 1) because the otheir piece of code does not really
care about object owning the spinlock and so acquiring the spinlock is
"not nice". However it is guaranteed that the piece of code that
accesses lock runs atomically with interrupts disabled. So
rcu_read_lock() would be superfluos there.

Is it possible to still use list_for_each_rcu() and friends to access
that list without rcu_read_lock()? Or it is betteruse complete RCU
interface and eat cost of couple of extra instrctions?

-- 
Dmitry

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

end of thread, other threads:[~2007-06-15 21:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-15 19:00 Using RCU with rcu_read_lock()? Dmitry Torokhov
2007-06-15 19:04 ` Peter Zijlstra
2007-06-15 19:29   ` Dipankar Sarma
2007-06-15 20:12     ` Paul E. McKenney
2007-06-15 20:25       ` Dmitry Torokhov
2007-06-15 21:04         ` Paul E. McKenney
2007-06-15 21:09           ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox