eal/x86: use lock-prefixed instructions for SMP barrier
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Mon, 15 Jan 2018 15:09:31 +0000 (15:09 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 29 Jan 2018 15:50:04 +0000 (16:50 +0100)
commit096ffd811fe21d652e51f07a7859967ffaabc72c
tree9b5576b1587ae58145f0bcbe04ae5bb88b120227
parent93da5b59afc910475c99799ab05c4ab59fb058dd
eal/x86: use lock-prefixed instructions for SMP barrier

On x86 it is possible to use lock-prefixed instructions to get
the similar effect as mfence.
As pointed by Java guys, on most modern HW that gives a better
performance than using mfence:
https://shipilev.net/blog/2014/on-the-fence-with-dependencies/
That patch adopts that technique for rte_smp_mb() implementation.
On BDW 2.2 mb_autotest on single lcore reports 2X cycle reduction,
i.e. from ~110 to ~55 cycles per operation.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/common/include/arch/x86/rte_atomic.h