linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question on RDMA atomic operations
@ 2016-08-24 20:42 Dong Young Yoon
       [not found] ` <DB0C5879-C46D-47BF-98F8-DECE15CC4D08-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Dong Young Yoon @ 2016-08-24 20:42 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hi,

My name is Dong Young and I am a PhD student at the University of Michigan.
Recently, we have been working on a research topic related to RDMA and had an observation where there is a race condition between RDMA atomic operations (e.g., fetch-and-add) and RDMA 1-sided writes.
We would like to verity whether what we observed is actually true (i.e., no atomicity guaranteed between RDMA atomic operation and RDMA read/write).
Is it really true? I have also contacted other fellow researchers who worked on RDMA, but they do not seem to be 100% sure on this matter.
Thank you so much in advance for your help.

Thanks,
Dong Young--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question on RDMA atomic operations
       [not found] ` <DB0C5879-C46D-47BF-98F8-DECE15CC4D08-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
@ 2016-08-25  7:11   ` Majd Dibbiny
       [not found]     ` <E7A19716-E97F-4BC3-9865-3740F7847AF7-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Majd Dibbiny @ 2016-08-25  7:11 UTC (permalink / raw)
  To: Dong Young Yoon; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA


> On Aug 24, 2016, at 11:43 PM, Dong Young Yoon <dyoon-63aXycvo3TyHXe+LvDLADg@public.gmane.org> wrote:
> 
> Hi,
> 
> My name is Dong Young and I am a PhD student at the University of Michigan.
> Recently, we have been working on a research topic related to RDMA and had an observation where there is a race condition between RDMA atomic operations (e.g., fetch-and-add) and RDMA 1-sided writes.
> We would like to verity whether what we observed is actually true (i.e., no atomicity guaranteed between RDMA atomic operation and RDMA read/write).
Hi Dong,

If you post an atomic operation followed by RDMA read/write, you need a fence between the two, because the second one might start processing before the first one has completed processing. 

In order to do that, you need to set the IBV_SEND_FENCE in the send_flags of the wr.

> Is it really true? I have also contacted other fellow researchers who worked on RDMA, but they do not seem to be 100% sure on this matter.
> Thank you so much in advance for your help.
> 
> Thanks,
> Dong Young--
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question on RDMA atomic operations
       [not found]     ` <E7A19716-E97F-4BC3-9865-3740F7847AF7-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2016-08-25 21:11       ` Asgeir Eiriksson
       [not found]         ` <F998C7B6-4095-43A6-A717-350C097E3125-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Asgeir Eiriksson @ 2016-08-25 21:11 UTC (permalink / raw)
  To: Dong Young Yoon; +Cc: Majd Dibbiny, linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello Dong,

The ordering rules for iWARP RDMA are spelled out in RFC7306 (see https://tools.ietf.org/pdf/rfc7306.pdf section 5, pp. 24 for the two ordering cases you asked about) and RFC5040 has the rest of the iWARP RDMA ordering rules

The answer to your question is the same for iWARP RDMA as that provided by Majd for IB

Regards,

‘Asgeir


> On Aug 25, 2016, at 12:11 AM, Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> 
> 
>> On Aug 24, 2016, at 11:43 PM, Dong Young Yoon <dyoon-63aXycvo3TyHXe+LvDLADg@public.gmane.org> wrote:
>> 
>> Hi,
>> 
>> My name is Dong Young and I am a PhD student at the University of Michigan.
>> Recently, we have been working on a research topic related to RDMA and had an observation where there is a race condition between RDMA atomic operations (e.g., fetch-and-add) and RDMA 1-sided writes.
>> We would like to verity whether what we observed is actually true (i.e., no atomicity guaranteed between RDMA atomic operation and RDMA read/write).
> Hi Dong,
> 
> If you post an atomic operation followed by RDMA read/write, you need a fence between the two, because the second one might start processing before the first one has completed processing. 
> 
> In order to do that, you need to set the IBV_SEND_FENCE in the send_flags of the wr.
> 
>> Is it really true? I have also contacted other fellow researchers who worked on RDMA, but they do not seem to be 100% sure on this matter.
>> Thank you so much in advance for your help.
>> 
>> Thanks,
>> Dong Young--
>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question on RDMA atomic operations
       [not found]         ` <F998C7B6-4095-43A6-A717-350C097E3125-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-08-25 21:15           ` Dong Young Yoon
       [not found]             ` <95397BB1-B414-4872-A926-1A2CC229EB40-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Dong Young Yoon @ 2016-08-25 21:15 UTC (permalink / raw)
  To: Asgeir Eiriksson; +Cc: Majd Dibbiny, linux-rdma-u79uwXL29TY76Z2rM5mHXA

Thank you so much for the answers. However, the case I was meaning to discuss is where there are multiple client/threads using different send queues, sending RDMA atomic and write operations concurrently to the same HCA as the responder. I understand that even for single send queue, there could be inconsistent ordering between RDMA atomic operations and reads and that is why we need to use FENCE, but I suppose it does not apply in my case?

Thanks,
Dong Young

> On Aug 25, 2016, at 5:11 PM, Asgeir Eiriksson <asgeir.eiriksson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> Hello Dong,
> 
> The ordering rules for iWARP RDMA are spelled out in RFC7306 (see https://tools.ietf.org/pdf/rfc7306.pdf section 5, pp. 24 for the two ordering cases you asked about) and RFC5040 has the rest of the iWARP RDMA ordering rules
> 
> The answer to your question is the same for iWARP RDMA as that provided by Majd for IB
> 
> Regards,
> 
> ‘Asgeir
> 
> 
>> On Aug 25, 2016, at 12:11 AM, Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
>> 
>> 
>>> On Aug 24, 2016, at 11:43 PM, Dong Young Yoon <dyoon-63aXycvo3TyHXe+LvDLADg@public.gmane.org> wrote:
>>> 
>>> Hi,
>>> 
>>> My name is Dong Young and I am a PhD student at the University of Michigan.
>>> Recently, we have been working on a research topic related to RDMA and had an observation where there is a race condition between RDMA atomic operations (e.g., fetch-and-add) and RDMA 1-sided writes.
>>> We would like to verity whether what we observed is actually true (i.e., no atomicity guaranteed between RDMA atomic operation and RDMA read/write).
>> Hi Dong,
>> 
>> If you post an atomic operation followed by RDMA read/write, you need a fence between the two, because the second one might start processing before the first one has completed processing. 
>> 
>> In order to do that, you need to set the IBV_SEND_FENCE in the send_flags of the wr.
>> 
>>> Is it really true? I have also contacted other fellow researchers who worked on RDMA, but they do not seem to be 100% sure on this matter.
>>> Thank you so much in advance for your help.
>>> 
>>> Thanks,
>>> Dong Young--
>>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question on RDMA atomic operations
       [not found]             ` <95397BB1-B414-4872-A926-1A2CC229EB40-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
@ 2016-08-29 12:25               ` Tom Talpey
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Talpey @ 2016-08-29 12:25 UTC (permalink / raw)
  To: Dong Young Yoon, Asgeir Eiriksson
  Cc: Majd Dibbiny, linux-rdma-u79uwXL29TY76Z2rM5mHXA

There is no ordering guarantee between writes and atomics at the
responder. And as you observe, FENCE is only applicable at a single
requestor. Your desired semantic will be possible only with upper-layer
interaction between the multiple requestors.

You should be aware that atomic data does not necessarily reside in
host memory. Because the adapter sits on the PCI bus, and there is
currently no atomic PCI transaction, the RDMA protocol specs permit
the adapter to provide the atomic behavior internally. The data will
eventually reach main memory, but not atomically. Also note, this means
an application running on the CPU of the responder may also encounter
the race you describe.

Tom.

On 8/25/2016 5:15 PM, Dong Young Yoon wrote:
> Thank you so much for the answers. However, the case I was meaning to discuss is where there are multiple client/threads using different send queues, sending RDMA atomic and write operations concurrently to the same HCA as the responder. I understand that even for single send queue, there could be inconsistent ordering between RDMA atomic operations and reads and that is why we need to use FENCE, but I suppose it does not apply in my case?
>
> Thanks,
> Dong Young
>
>> On Aug 25, 2016, at 5:11 PM, Asgeir Eiriksson <asgeir.eiriksson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> Hello Dong,
>>
>> The ordering rules for iWARP RDMA are spelled out in RFC7306 (see https://tools.ietf.org/pdf/rfc7306.pdf section 5, pp. 24 for the two ordering cases you asked about) and RFC5040 has the rest of the iWARP RDMA ordering rules
>>
>> The answer to your question is the same for iWARP RDMA as that provided by Majd for IB
>>
>> Regards,
>>
>> ‘Asgeir
>>
>>
>>> On Aug 25, 2016, at 12:11 AM, Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
>>>
>>>
>>>> On Aug 24, 2016, at 11:43 PM, Dong Young Yoon <dyoon-63aXycvo3TyHXe+LvDLADg@public.gmane.org> wrote:
>>>>
>>>> Hi,
>>>>
>>>> My name is Dong Young and I am a PhD student at the University of Michigan.
>>>> Recently, we have been working on a research topic related to RDMA and had an observation where there is a race condition between RDMA atomic operations (e.g., fetch-and-add) and RDMA 1-sided writes.
>>>> We would like to verity whether what we observed is actually true (i.e., no atomicity guaranteed between RDMA atomic operation and RDMA read/write).
>>> Hi Dong,
>>>
>>> If you post an atomic operation followed by RDMA read/write, you need a fence between the two, because the second one might start processing before the first one has completed processing.
>>>
>>> In order to do that, you need to set the IBV_SEND_FENCE in the send_flags of the wr.
>>>
>>>> Is it really true? I have also contacted other fellow researchers who worked on RDMA, but they do not seem to be 100% sure on this matter.
>>>> Thank you so much in advance for your help.
>>>>
>>>> Thanks,
>>>> Dong Young--
>>>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>>>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-29 12:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-24 20:42 Question on RDMA atomic operations Dong Young Yoon
     [not found] ` <DB0C5879-C46D-47BF-98F8-DECE15CC4D08-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
2016-08-25  7:11   ` Majd Dibbiny
     [not found]     ` <E7A19716-E97F-4BC3-9865-3740F7847AF7-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-08-25 21:11       ` Asgeir Eiriksson
     [not found]         ` <F998C7B6-4095-43A6-A717-350C097E3125-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-08-25 21:15           ` Dong Young Yoon
     [not found]             ` <95397BB1-B414-4872-A926-1A2CC229EB40-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
2016-08-29 12:25               ` Tom Talpey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).