[dpdk-dev] [PATCH v4 0/4] generic rte atomic APIs deprecate proposal

Phil Yang Phil.Yang at arm.com
Tue May 12 10:18:33 CEST 2020


+ David Christensen

The PPC c11 atomics maintainer.

My apologies, I forgot to cc you on this email.

Thanks,
Phil Yang

> -----Original Message-----
> From: Phil Yang <phil.yang at arm.com>
> Sent: Tuesday, May 12, 2020 4:03 PM
> To: thomas at monjalon.net; dev at dpdk.org
> Cc: bruce.richardson at intel.com; ferruh.yigit at intel.com;
> hemant.agrawal at nxp.com; Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.com>; jerinj at marvell.com;
> ktraynor at redhat.com; konstantin.ananyev at intel.com;
> maxime.coquelin at redhat.com; olivier.matz at 6wind.com;
> stephen at networkplumber.org; mb at smartsharesystems.com;
> mattias.ronnblom at ericsson.com; harry.van.haaren at intel.com;
> erik.g.carrillo at intel.com; Phil Yang <Phil.Yang at arm.com>; nd <nd at arm.com>
> Subject: [PATCH v4 0/4] generic rte atomic APIs deprecate proposal
> 
> DPDK provides generic rte_atomic APIs to do several atomic operations.
> These APIs are using the deprecated __sync built-ins and enforce full
> memory barriers on aarch64. However, full barriers are not necessary
> in many use cases. In order to address such use cases, C language offers
> C11 atomic APIs. The C11 atomic APIs provide finer memory barrier control
> by making use of the memory ordering parameter provided by the user.
> Various patches submitted in the past [2] and the patches in this series
> indicate significant performance gains on multiple aarch64 CPUs and no
> performance loss on x86.
> 
> But the existing rte_atomic API implementations cannot be changed as the
> APIs do not take the memory ordering parameter. The only choice available
> is replacing the usage of the rte_atomic APIs with C11 atomic APIs. In
> order to make this change, the following steps are proposed:
> 
> [1] deprecate rte_atomic APIs so that future patches do not use rte_atomic
> APIs (a script is added to flag the usages).
> [2] refactor the code that uses rte_atomic APIs to use c11 atomic APIs.
> 
> This patchset contains:
> 1) changes to programmer guide describing writing efficient code for aarch64.
> 2) the checkpatch script changes to flag rte_atomicNN_xxx API usage in
> patches.
> 3) wraps up compiler __atomic built-ins with explicit memory ordering
> parameter.
> 
> v4:
> 1. add reader-writer concurrency case describing.
> 2. claim maintainership of c11 atomics code for each platforms.
> 3. flag rte_atomicNN_xxx in new patches for modules that have been
> converted to
> c11 style.
> 4. flag __sync_xxx built-ins in new patches.
> 5. wraps up compiler atomic built-ins
> 6. move the changes of libraries which make use of c11 atomic APIs out of
> this
> patchset.
> 
> v3:
> add libatomic dependency for 32-bit clang
> 
> v2:
> 1. fix Clang '-Wincompatible-pointer-types' WARNING.
> 2. fix typos.
> 
> 
> Phil Yang (4):
>   doc: add generic atomic deprecation section
>   maintainers: claim maintainers of c11 atomics code
>   devtools: prevent use of rte atomic APIs in future patches
>   eal/atomic: add wrapper for c11 atomics
> 
>  MAINTAINERS                                      |   4 +
>  devtools/checkpatches.sh                         |  23 ++++
>  doc/guides/prog_guide/writing_efficient_code.rst | 139
> ++++++++++++++++++++++-
>  lib/librte_eal/include/generic/rte_atomic_c11.h  | 139
> +++++++++++++++++++++++
>  lib/librte_eal/include/meson.build               |   1 +
>  5 files changed, 305 insertions(+), 1 deletion(-)
>  create mode 100644 lib/librte_eal/include/generic/rte_atomic_c11.h
> 
> --
> 2.7.4



More information about the dev mailing list