Quoting r. Tom Tucker <[EMAIL PROTECTED]>:
> Subject: Re: [openib-general] Re: [PATCH] cm refcount race fix
> 
> On Mon, 2006-05-08 at 08:53 -0700, Roland Dreier wrote:
> >  > +        /* Make sure cm_deref_id is not in progress */
> >  > +        spin_lock_irq(&cm_id_priv->lock);
> >  > +        spin_unlock_irq(&cm_id_priv->lock);
> > 
> > How does this help anything?  cm_deref_id() can still be in progress,
> > it just can't hold the lock during this empty section of code.
> > 
> 
> Maybe Michael means this...
> 
> 
> T1
>       
>       spin_lock_irq(&obj->lock);
>       if (atomic_dec_and_test(&obj->refcount))
>               wake_up(&obj->wait);
>       spin_unlock_irq(&obj->lock);
> 
> T2
> 
>       atomic_dec(&obj->refcount);
>       wait_event(&obj->wait, !atomic_read(&obj->refcount))
>       spin_lock_irq(&obj->lock);
>       spin_unlock_irq(&obj->lock);
>       kfree(obj);
> 

Right, that's what the patch does. No?

-- 
MST
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to