Skip to content

use c11 atomics for service core lib

Phil Yang dpdk-dev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest6 patches 1 replyIn review
  2. v56 patches 0 repliesSuperseded
  3. v26 patches 5 repliesSuperseded

Changes in v6 from the cover letter

1. Fix coding style issue. Remove illegal Change-ID tag in patch 5/6.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6service: fix race condition for MT unsafe servicelib/librte_eal/common/rte_service.c lib/librte_eal/include/rte_service.h lib/librte_eal/include/rte_service_component.h+16 -90 replies
2/6service: fix identification of service running on other lcorelib/librte_eal/common/rte_service.c+8 -180 replies
3/6service: remove rte prefix from static functionslib/librte_eal/common/rte_service.c+11 -230 replies
4/6service: remove redundant codelib/librte_eal/common/rte_service.c+6 -220 replies
5/6service: optimize with c11 atomicslib/librte_eal/common/rte_service.c+18 -140 replies
6/6service: relax barriers with C11 atomicslib/librte_eal/common/rte_service.c+84 -310 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchPhil YangHarry van HaarenHonnappa Nagarahalli
1/6R-b A-b
2/6R-b A-b
3/6A-b R-b
4/6A-b R-b
5/6A-b R-b
6/6A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v6 thread

Cover letter [dpdk-dev] [PATCH v6 0/6] use c11 atomics for service core lib

The rte_atomic ops and rte_smp barriers enforce DMB barriers on aarch64. Using c11 atomics with explicit memory ordering instead of the rte_atomic ops and rte_smp barriers for inter-threads synchronization can uplift the performance on aarch64 and no performance loss on x86.

This patchset contains:
1) fix race condition for MT unsafe service.
2) clean up redundant code.
3) use c11 atomics for service core lib to avoid unnecessary barriers.

v2:
Still waiting on Harry for the final solution on the MT unsafe race condition issue. But I have incorporated the comments so far.
1. add 'Fixes' tag for bug-fix patches.
2. remove 'Fixes' tag for code cleanup patches.
3. remove unused parameter for service_dump_one function.
4. replace the execute_lock atomic CAS operation to spinlock_try_lock.
5. use c11 atomics with RELAXED memory ordering for num_mapped_cores.
6. relax barriers for guard variables runstate, comp_runstate and app_runstate with c11 one-way barriers.

v3:
Sending this version since Phil is on holiday.
1. Updated the API documentation to indicate how the locking can be avoided.

v4:
1. Fix the nits in 2/6 commit message and comments in code.

v5:
1. Remove redundant libatomic clang dependency claim code as it has been added in global. (The commit da4eae278b56)

v6:
1. Fix coding style issue. Remove illegal Change-ID tag in patch 5/6.

Honnappa Nagarahalli (2):
service: fix race condition for MT unsafe service
service: fix identification of service running on other lcore

Phil Yang (4):
service: remove rte prefix from static functions
service: remove redundant code
service: optimize with c11 atomics
service: relax barriers with C11 atomics

 lib/librte_eal/common/rte_service.c            | 234 +++++++++++++------------
 lib/librte_eal/include/rte_service.h           |   8 +-
 lib/librte_eal/include/rte_service_component.h |   6 +-
 3 files changed, 137 insertions(+), 111 deletions(-)
Signature · 1 line
2.7.4