[dpdk-dev] [PATCH v3 3/3] ring: move the atomic load of head above the loop

Jerin Jacob jerin.jacob at caviumnetworks.com
Sat Sep 29 12:59:48 CEST 2018


-----Original Message-----
> Date: Mon, 17 Sep 2018 16:17:24 +0800
> From: Gavin Hu <gavin.hu at arm.com>
> To: dev at dpdk.org
> CC: gavin.hu at arm.com, Honnappa.Nagarahalli at arm.com, steve.capper at arm.com,
>  Ola.Liljedahl at arm.com, jerin.jacob at caviumnetworks.com, nd at arm.com,
>  stable at dpdk.org
> Subject: [PATCH v3 3/3] ring: move the atomic load of head above the loop
> X-Mailer: git-send-email 2.7.4
> 
> External Email
> 
> 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 at dpdk.org
> 
> Signed-off-by: Gavin Hu <gavin.hu at arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli at arm.com>
> Reviewed-by: Steve Capper <steve.capper at arm.com>
> Reviewed-by: Ola Liljedahl <Ola.Liljedahl at arm.com>

Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
Tested-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>



More information about the dev mailing list