[openib-general] [PATCH fixed] was Re: [PATCH] ipoib_multicast/ipoib_mcast_send race

Krishna Kumar2 krkumar2 at in.ibm.com
Mon Dec 12 03:30:04 PST 2005


Hi Michael,

(wow, don't you sleep!)

> I think this will work, too. But I have easier time reasoning about 
locks than
> barriers and atomic operations. "bit is protected by priv->lock" is a 
simple

Correct.

Also, some optimization in mcast_send() could be done by moving the label 
"out:" 
to just before the spin_unlock() (and change "mcast = NULL" to "goto 
out").

- KK

"Michael S. Tsirkin" <mst at mellanox.co.il> wrote on 12/12/2005 04:33:50 PM:

> Quoting Krishna Kumar2 <krkumar2 at in.ibm.com>:
> > stop_thread() 
> > { 
> >         clear_bit(); 
> >         lock();        /* empty lock/unlock to synchronize with the 
mcast_send() */ 
> >         unlock(); /* make the other routine FINISH before we start 
other activity */ 
> >         ... 
> >         ... 
> > } 
> > mcast_send() 
> > { 
> >         lock(); 
> >         if (test_bit) 
> >         ... 
> >         ... 
> >         unlock(); 
> > } 
> 
> I think this will work, too. But I have easier time reasoning about 
locks than
> barriers and atomic operations. "bit is protected by priv->lock" is a 
simple
> rule, and we are not on data path here.
> 
> The fact that the race went unnoticed for a while validates this 
approach
> in my eyes.
> 
> -- 
> MST
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20051212/00626efe/attachment.html>


More information about the general mailing list