rwlock: add HTM lock elision for x86
authorRoman Dementiev <roman.dementiev@intel.com>
Fri, 19 Jun 2015 11:08:22 +0000 (13:08 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 19 Jun 2015 14:24:48 +0000 (16:24 +0200)
commit63af6fcfe1fd9b53a4ea045232bbd3913afaca3a
tree0376f7cb76d1ecf3c75611a1c5350de9ded577ea
parentba7468997ea6dd7a019ea00367c56867eb6431e9
rwlock: add HTM lock elision for x86

This patch adds methods that use hardware memory transactions (HTM) on
fast-path for rwlock (a.k.a. lock elision). Here the methods are implemented
for x86 using Restricted Transactional Memory instructions (Intel(r)
Transactional Synchronization Extensions). The implementation fall-backs to
the normal rwlock if HTM is not available or memory transactions fail. This is
not a replacement for all rwlock usages since not all critical sections
protected by locks are friendly to HTM. For example, an attempt to perform
a HW I/O operation inside a hardware memory transaction always aborts
the transaction since the CPU is not able to roll-back should the transaction
fail. Therefore, hardware transactional locks are not advised to be used around
rte_eth_rx_burst() and rte_eth_tx_burst() calls.

Signed-off-by: Roman Dementiev <roman.dementiev@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/common/Makefile
lib/librte_eal/common/include/arch/ppc_64/rte_rwlock.h [new file with mode: 0644]
lib/librte_eal/common/include/arch/x86/rte_rwlock.h [new file with mode: 0644]
lib/librte_eal/common/include/generic/rte_rwlock.h [new file with mode: 0644]
lib/librte_eal/common/include/rte_rwlock.h [deleted file]