service: optimize with C11 atomics
authorPhil Yang <phil.yang@arm.com>
Wed, 6 May 2020 15:28:03 +0000 (23:28 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 11 May 2020 11:21:54 +0000 (13:21 +0200)
commit41e8227e207c5db2ab3fd0ceaa88de751d811749
tree3bf3f3b27fa4768a76baeb9a8d385fbe8d48fc3c
parent6c8d14ffbb9a7a2a066c24554fe7c231014e7f6d
service: optimize with C11 atomics

The num_mapped_cores is used as a statistics. Use c11 atomics with
RELAXED ordering for num_mapped_cores instead of rte_atomic ops which
enforce unnessary barriers on aarch64.

Replace execute_lock operations to spinlock_try_lock to avoid duplicate
code.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
lib/librte_eal/common/rte_service.c