Quoting r. Sean Hefty <[EMAIL PROTECTED]>:
> Subject: Re: [openib-general] Re: [PATCH] cm refcount race fix
> 
> Michael S. Tsirkin wrote:
> > static inline void cm_deref_id(struct cm_id_private *cm_id_priv)
> > {
> >+    unsigned long flags;
> >+
> >+    spin_lock_irqsave(&cm_id_priv->lock, flags);
> >     if (atomic_dec_and_test(&cm_id_priv->refcount))
> >             wake_up(&cm_id_priv->wait);
> >+    spin_unlock_irqrestore(&cm_id_priv->lock, flags);
> > }
> 
> Could we use atomic_dec_and_lock() instead?  This would keep refcount 
> atomic, but use a spinlock to synchronize with destruction.

I think that'd work too.

-- 
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