[ofiwg] help analyzing ring buffer implementation

Hefty, Sean sean.hefty at intel.com
Fri Sep 22 09:09:12 PDT 2017


> And, as written, it is allowed for this CPU to observe rb->wcnt being
> updated before ofi_rbwrite has happened, and this would be a
> malfunction.
> 
> You must either wrap all reads and writes in a lock to gain
> serialization, or you must use stdatomic for the store and load sides
> of the cnt values with an appropriate strength ordering mode.

Got it -- thanks.

> I'm not sure what you 'fastlock' is these days, but it should also be
> expressed in terms of stdatomic, see how I reworked the similar code
> in rdma-core.

I believe it maps to spinlock on Linux.



More information about the ofiwg mailing list