Re: [PATCH 1/7] introduce atomic_dec_and_lock_irqsave() [message #5788 is a reply to message #5740] |
Wed, 30 August 2006 17:25   |
Roman Zippel
Messages: 4 Registered: August 2006
|
Junior Member |
|
|
Hi,
On Wed, 30 Aug 2006, Dipankar Sarma wrote:
> > > uidhash_lock can be taken from irq context. For example, delayed_put_task_struct()
> > > does __put_task_struct()->free_uid().
> >
> > AFAICT it's called via rcu, does that mean anything released via rcu has
> > to be protected against interrupts?
>
> No. You need protection only if you have are using some
> data that can also be used by the RCU callback. For example,
> if your RCU callback just calls kfree(), you don't have to
> do a spin_lock_bh().
In this case kfree() does its own interrupt synchronization. I didn't
realize before that rcu had this (IMO serious) limitation. I think there
should be two call_rcu() variants, one that queues the callback in a soft
irq and a second which queues it in a thread context.
bye, Roman
|
|
|