[openib-general] Re: [PATCH (updated)] ipoib: dont lock tx on completion

Michael S. Tsirkin mst at mellanox.co.il
Thu Feb 10 11:40:56 PST 2005


Quoting r. Roland Dreier <roland at topspin.com>:
> Subject: Re: [PATCH (updated)] ipoib: dont lock tx on completion
> 
>     Michael> Hmm, I think I have it covered.
> 
>     Michael> If the read of netif_queue_stopped is delayed by a huge
>     Michael> margin, we see the interface stopped and wake it up.
> 
>     Michael> If the read of tx_tail is delayed, we see the tail
>     Michael> updated and wake it up in the send routine.
> 
>     Michael> No? What is the race you see?
> 
> I think the wmb() has to at least become barrier() -- otherwise the
> send routine has no reason to reread tx_tail after it stops the queue.
> 
> I don't see a specific race -- I'm just not totally comfortable yet,
> even with that fixed.  The issue is not necessarily reads being
> delayed, since both an out-of-order CPU and a compiler may move reads
> much _earlier_ than they appear in the code (for example a read may be
> speculatively executed because of branch prediction for a test in an
> if statement).
> 
>  - R.
> 

Can they be moved to before the wmb? I think not.

-- 
MST - Michael S. Tsirkin



More information about the general mailing list