* [PATCH 0/2] Add support for enhanced atomic operations
@ 2010-02-01 15:59 Vladimir Sokolovsky
[not found] ` <4B66FA54.6030408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Sokolovsky @ 2010-02-01 15:59 UTC (permalink / raw)
To: Roland Dreier; +Cc: linux-rdma
Hi Roland,
This patchset adds support for the following enhanced atomic operations:
- Masked atomic compare and swap
- Masked atomic fetch and add
These operations enable using a smaller amount of memory when using multiple locks
by using portions of a 64 bit value in an atomic operation.
Vladimir Sokolovsky(2):
IB/core: Add support for enhanced atomic operations
mlx4/IB: Add support for enhanced atomic operations
drivers/infiniband/hw/mlx4/cq.c | 8 ++++++++
drivers/infiniband/hw/mlx4/main.c | 2 ++
drivers/infiniband/hw/mlx4/qp.c | 27 +++++++++++++++++++++++++++
include/linux/mlx4/device.h | 4 ++--
include/linux/mlx4/qp.h | 7 +++++++
include/rdma/ib_verbs.h | 9 ++++++++-
6 files changed, 54 insertions(+), 3 deletions(-)
Regards,
Vladimir
--
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] 10+ messages in thread[parent not found: <4B66FA54.6030408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>]
* RE: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <4B66FA54.6030408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> @ 2010-02-01 22:11 ` Sean Hefty [not found] ` <52BD554704A742B18E3F2F8F2B00B9FE-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Sean Hefty @ 2010-02-01 22:11 UTC (permalink / raw) To: 'Vladimir Sokolovsky', Roland Dreier; +Cc: linux-rdma >This patchset adds support for the following enhanced atomic operations: >- Masked atomic compare and swap >- Masked atomic fetch and add Can you explain these in more detail? How exactly is a mask used? Are there any restrictions on the format of the mask? How is the mask carried over the wire? etc. -- 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] 10+ messages in thread
[parent not found: <52BD554704A742B18E3F2F8F2B00B9FE-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>]
* Re: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <52BD554704A742B18E3F2F8F2B00B9FE-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org> @ 2010-02-02 10:44 ` Vladimir Sokolovsky [not found] ` <4B68020D.4080401-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Vladimir Sokolovsky @ 2010-02-02 10:44 UTC (permalink / raw) To: Sean Hefty; +Cc: Roland Dreier, linux-rdma Sean Hefty wrote: >> This patchset adds support for the following enhanced atomic operations: >> - Masked atomic compare and swap >> - Masked atomic fetch and add > > Can you explain these in more detail? How exactly is a mask used? Are there > any restrictions on the format of the mask? How is the mask carried over the > wire? etc. > > -- Masked Compare and Swap (MskCmpSwap) The MskCmpSwap atomic operation is an extension to the CmpSwap operation defined in the IB spec. MskCmpSwap allows the user to select a portion of the 64 bit target data for the “compare” check as well as to restrict the swap to a (possibly different) portion. The pseudo code below describes the operation: ----- atomic_response = *va if (((cmp XOR *va) AND cmp_mask) is ZERO) then *va = (*va AND NOT(swap_mask)) OR (swap AND swap_mask) return atomic_response ----- The additional operands are carried in the Extended Transport Header. Atomic response generation and packet format for MskCmpSwap is as for standard IB Atomic operations. Masked Fetch and Add (MFetchAdd) The MFetchAdd Atomic operation extends the functionality of the standard IB FetchAdd by allowing the user to split the target into multiple fields of selectable length. The atomic add is done independently on each one of this fields. A bit set in the field_boundary parameter specifies the field boundaries. The pseudo code below describes the operation: ------------ bit_adder(ci, b1, b2, *co) { value = ci + b1 + b2; if (value & 2) *co = 1 else *co = 0 return value & 1 } mask = 1 carry = 0 atomic_response = *va #define MASK_IS_SET(mask, attr) (((mask)&(attr))!=0) for i = 0 to 63 { if ( i != 0 ) mask = mask << 1; bit_add_res = bit_adder(carry, MASK_IS_SET(atomic_response, mask), MASK_IS_SET(add_value, mask), &new_carry) if (bit_add_res) atomic_response |= mask carry = ((new_carry) && (!MASK_IS_SET(cmp_mask, mask))) } return atomic_response ------------ The additional operands are carried in the Extended Transport Header. Atomic response generation and packet format for MFetchAdd is as for standard IB Atomic operations. Regards, Vladimir -- 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] 10+ messages in thread
[parent not found: <4B68020D.4080401-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>]
* Re: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <4B68020D.4080401-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> @ 2010-02-02 15:54 ` Hal Rosenstock [not found] ` <f0e08f231002020754h482ba0f7xe35a78a72cc165e8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Hal Rosenstock @ 2010-02-02 15:54 UTC (permalink / raw) To: Vladimir Sokolovsky; +Cc: Sean Hefty, Roland Dreier, linux-rdma On Tue, Feb 2, 2010 at 5:44 AM, Vladimir Sokolovsky <vlad-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote: > Sean Hefty wrote: >>> >>> This patchset adds support for the following enhanced atomic operations: >>> - Masked atomic compare and swap >>> - Masked atomic fetch and add >> >> Can you explain these in more detail? How exactly is a mask used? Are >> there >> any restrictions on the format of the mask? How is the mask carried over >> the >> wire? etc. >> >> -- > > Masked Compare and Swap (MskCmpSwap) > The MskCmpSwap atomic operation is an extension to the CmpSwap operation > defined in the IB > spec. MskCmpSwap allows the user to select a portion of the 64 bit target > data for the “compare” > check as well as to restrict the swap to a (possibly different) portion. The > pseudo code below > describes the operation: > > ----- > atomic_response = *va > if (((cmp XOR *va) AND cmp_mask) is ZERO) then > *va = (*va AND NOT(swap_mask)) OR (swap AND swap_mask) > > return atomic_response > ----- > > The additional operands are carried in the Extended Transport Header. Atomic > response generation > and packet format for MskCmpSwap is as for standard IB Atomic operations. > > > Masked Fetch and Add (MFetchAdd) > The MFetchAdd Atomic operation extends the functionality of the standard IB > FetchAdd by > allowing the user to split the target into multiple fields of selectable > length. The atomic add is done > independently on each one of this fields. A bit set in the field_boundary > parameter specifies the > field boundaries. The pseudo code below describes the operation: > > ------------ > bit_adder(ci, b1, b2, *co) > { > value = ci + b1 + b2; > > if (value & 2) > *co = 1 > else > *co = 0 > > return value & 1 > } > > mask = 1 > carry = 0 > atomic_response = *va > #define MASK_IS_SET(mask, attr) (((mask)&(attr))!=0) > > for i = 0 to 63 > { > if ( i != 0 ) > mask = mask << 1; > > bit_add_res = bit_adder(carry, MASK_IS_SET(atomic_response, mask), > MASK_IS_SET(add_value, mask), &new_carry) > if (bit_add_res) > atomic_response |= mask > > carry = ((new_carry) && (!MASK_IS_SET(cmp_mask, mask))) > } > > return atomic_response > ------------ > > The additional operands are carried in the Extended Transport Header. Atomic > response generation > and packet format for MFetchAdd is as for standard IB Atomic operations. Will Mellanox be adding this option to the IB spec rather than keep it as vendor proprietary ? -- Hal > > Regards, > Vladimir > -- > 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] 10+ messages in thread
[parent not found: <f0e08f231002020754h482ba0f7xe35a78a72cc165e8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <f0e08f231002020754h482ba0f7xe35a78a72cc165e8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2010-02-02 16:13 ` Håkon Bugge 2010-02-03 0:02 ` Sean Hefty 2010-02-03 7:08 ` Tziporet Koren 2 siblings, 0 replies; 10+ messages in thread From: Håkon Bugge @ 2010-02-02 16:13 UTC (permalink / raw) To: Hal Rosenstock; +Cc: Vladimir Sokolovsky, Sean Hefty, Roland Dreier, linux-rdma On Feb 2, 2010, at 16:54 , Hal Rosenstock wrote: > On Tue, Feb 2, 2010 at 5:44 AM, Vladimir Sokolovsky >> [snip] >> Masked Fetch and Add (MFetchAdd) >> The MFetchAdd Atomic operation extends the functionality of the standard IB >> FetchAdd by >> allowing the user to split the target into multiple fields of selectable >> length. The atomic add is done >> independently on each one of this fields. A bit set in the field_boundary >> parameter specifies the >> field boundaries. The pseudo code below describes the operation: As discussed by private email, my take is that it is more important to support adjacent fields than a single-bit fetch-and-add. Hence, encoding the mask slightly different where a one-to-zero bit transition indicates break-of-carry, but mask-wise treated as a one, allows adjacent bit-fields to be added. Just my two cents. Håkon -- 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] 10+ messages in thread
* RE: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <f0e08f231002020754h482ba0f7xe35a78a72cc165e8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2010-02-02 16:13 ` Håkon Bugge @ 2010-02-03 0:02 ` Sean Hefty [not found] ` <F1F846D4754246DC862643839C4CB216-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org> 2010-02-03 7:08 ` Tziporet Koren 2 siblings, 1 reply; 10+ messages in thread From: Sean Hefty @ 2010-02-03 0:02 UTC (permalink / raw) To: 'Hal Rosenstock', Vladimir Sokolovsky; +Cc: Roland Dreier, linux-rdma >Will Mellanox be adding this option to the IB spec rather than keep it >as vendor proprietary ? Along with that question, what is the use case for this feature? The only benefit mentioned was saving a few bytes of memory, at the cost of carrying extra network headers. Atomics are only 64-bits to begin with... -- 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] 10+ messages in thread
[parent not found: <F1F846D4754246DC862643839C4CB216-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>]
* Re: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <F1F846D4754246DC862643839C4CB216-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org> @ 2010-02-03 8:01 ` Vladimir Sokolovsky [not found] ` <4B692D67.5040006-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Vladimir Sokolovsky @ 2010-02-03 8:01 UTC (permalink / raw) To: Sean Hefty; +Cc: 'Hal Rosenstock', Roland Dreier, linux-rdma Sean Hefty wrote: >> Will Mellanox be adding this option to the IB spec rather than keep it >> as vendor proprietary ? > > Along with that question, what is the use case for this feature? The only > benefit mentioned was saving a few bytes of memory, at the cost of carrying > extra network headers. Atomics are only 64-bits to begin with... > For some applications the memory savings are very significant. One example is fine grain lock implementations for huge data sets. In other cases, the benefit is the ability to update multiple fields with a single io operation. Regards, Vladimir -- 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] 10+ messages in thread
[parent not found: <4B692D67.5040006-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>]
* Re: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <4B692D67.5040006-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> @ 2010-02-11 14:08 ` Hal Rosenstock [not found] ` <f0e08f231002110608y3a70c132r813d3472f82382d2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Hal Rosenstock @ 2010-02-11 14:08 UTC (permalink / raw) To: Vladimir Sokolovsky; +Cc: Sean Hefty, Roland Dreier, linux-rdma On Wed, Feb 3, 2010 at 3:01 AM, Vladimir Sokolovsky <vlad-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote: > Sean Hefty wrote: >>> >>> Will Mellanox be adding this option to the IB spec rather than keep it >>> as vendor proprietary ? >> >> Along with that question, what is the use case for this feature? The only >> benefit mentioned was saving a few bytes of memory, at the cost of >> carrying >> extra network headers. Atomics are only 64-bits to begin with... >> > > > For some applications the memory savings are very significant. One > example is fine grain lock implementations for huge data sets. In other > cases, the benefit is the ability to update multiple fields with a > single io operation. What happens when the other end doesn't support this feature (new opcodes) ? How can that be determined remotely ? Is some CM related change also needed ? -- Hal > > Regards, > Vladimir > -- 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] 10+ messages in thread
[parent not found: <f0e08f231002110608y3a70c132r813d3472f82382d2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <f0e08f231002110608y3a70c132r813d3472f82382d2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2010-02-14 13:24 ` Vladimir Sokolovsky 0 siblings, 0 replies; 10+ messages in thread From: Vladimir Sokolovsky @ 2010-02-14 13:24 UTC (permalink / raw) To: Hal Rosenstock; +Cc: Sean Hefty, Roland Dreier, linux-rdma Hal Rosenstock wrote: > On Wed, Feb 3, 2010 at 3:01 AM, Vladimir Sokolovsky > <vlad-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote: >> Sean Hefty wrote: >>>> Will Mellanox be adding this option to the IB spec rather than keep it >>>> as vendor proprietary ? >>> Along with that question, what is the use case for this feature? The only >>> benefit mentioned was saving a few bytes of memory, at the cost of >>> carrying >>> extra network headers. Atomics are only 64-bits to begin with... >>> >> >> For some applications the memory savings are very significant. One >> example is fine grain lock implementations for huge data sets. In other >> cases, the benefit is the ability to update multiple fields with a >> single io operation. > > What happens when the other end doesn't support this feature (new > opcodes) ? How can that be determined remotely ? Is some CM related > change also needed ? > > -- Hal > In this case the responder (the other end) will return a NAK-Invalid Request to the requester. There is no need to extend the CM protocol. This can be done as part of application negotiation. Atomic is an optional feature and the CM is not involved in negotiation of this. Application to application should decide if they want and they can use atomic. The same should be done for extended atomics. Regards, Vladimir -- 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] 10+ messages in thread
* Re: [PATCH 0/2] Add support for enhanced atomic operations [not found] ` <f0e08f231002020754h482ba0f7xe35a78a72cc165e8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2010-02-02 16:13 ` Håkon Bugge 2010-02-03 0:02 ` Sean Hefty @ 2010-02-03 7:08 ` Tziporet Koren 2 siblings, 0 replies; 10+ messages in thread From: Tziporet Koren @ 2010-02-03 7:08 UTC (permalink / raw) To: Hal Rosenstock; +Cc: Vladimir Sokolovsky, Sean Hefty, Roland Dreier, linux-rdma On 2/2/2010 5:54 PM, Hal Rosenstock wrote: > Will Mellanox be adding this option to the IB spec rather than keep it > as vendor proprietary ? > Yes, it's in our plans Tziporet -- 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] 10+ messages in thread
end of thread, other threads:[~2010-02-14 13:24 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01 15:59 [PATCH 0/2] Add support for enhanced atomic operations Vladimir Sokolovsky
[not found] ` <4B66FA54.6030408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-02-01 22:11 ` Sean Hefty
[not found] ` <52BD554704A742B18E3F2F8F2B00B9FE-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-02-02 10:44 ` Vladimir Sokolovsky
[not found] ` <4B68020D.4080401-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-02-02 15:54 ` Hal Rosenstock
[not found] ` <f0e08f231002020754h482ba0f7xe35a78a72cc165e8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-02 16:13 ` Håkon Bugge
2010-02-03 0:02 ` Sean Hefty
[not found] ` <F1F846D4754246DC862643839C4CB216-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-02-03 8:01 ` Vladimir Sokolovsky
[not found] ` <4B692D67.5040006-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-02-11 14:08 ` Hal Rosenstock
[not found] ` <f0e08f231002110608y3a70c132r813d3472f82382d2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-14 13:24 ` Vladimir Sokolovsky
2010-02-03 7:08 ` Tziporet Koren
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox