numam-dpdk/lib/librte_ring
Gavin Hu 047adc1724 ring/c11: move atomic load of head above the loop
In __rte_ring_move_prod_head, move the __atomic_load_n up and out of
the do {} while loop as upon failure the old_head will be updated,
another load is costly and not necessary.

This helps a little on the latency,about 1~5%.

 Test result with the patch(two cores):
 SP/SC bulk enq/dequeue (size: 8): 5.64
 MP/MC bulk enq/dequeue (size: 8): 9.58
 SP/SC bulk enq/dequeue (size: 32): 1.98
 MP/MC bulk enq/dequeue (size: 32): 2.30

Fixes: 39368ebfc6 ("ring: introduce C11 memory model barrier option")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Jia He <justin.he@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-11-05 14:34:27 +01:00
..
Makefile ring: relax alignment constraint on ring structure 2018-04-18 00:24:22 +02:00
meson.build ring: add library version to meson build 2018-10-25 14:30:05 +02:00
rte_ring_c11_mem.h ring/c11: move atomic load of head above the loop 2018-11-05 14:34:27 +01:00
rte_ring_generic.h ring: remove signed type flip-flopping 2018-05-21 00:20:16 +02:00
rte_ring_version.map lib: remove unused map symbols 2018-02-13 14:55:01 +01:00
rte_ring.c ring: convert license headers to SPDX tags 2018-02-01 01:46:45 +01:00
rte_ring.h config: rename option for C11 memory model 2018-10-26 18:09:22 +02:00