From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4258FA034F; Wed, 6 May 2020 17:28:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C91B61D942; Wed, 6 May 2020 17:28:48 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id C56331D939 for ; Wed, 6 May 2020 17:28:47 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 40208D6E; Wed, 6 May 2020 08:28:47 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0151E3F68F; Wed, 6 May 2020 08:28:40 -0700 (PDT) From: Phil Yang To: dev@dpdk.org, harry.van.haaren@intel.com Cc: thomas@monjalon.net, david.marchand@redhat.com, konstantin.ananyev@intel.com, jerinj@marvell.com, hemant.agrawal@nxp.com, gage.eads@intel.com, bruce.richardson@intel.com, Honnappa.Nagarahalli@arm.com, nd@arm.com Date: Wed, 6 May 2020 23:27:58 +0800 Message-Id: <1588778884-13047-1-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588760683-11027-1-git-send-email-phil.yang@arm.com> References: <1588760683-11027-1-git-send-email-phil.yang@arm.com> Subject: [dpdk-dev] [PATCH v6 0/6] use c11 atomics for service core lib X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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(-) -- 2.7.4