From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B8F4CA9EB5 for ; Mon, 21 Oct 2019 09:48:29 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id AE7E620830 for ; Mon, 21 Oct 2019 09:48:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE7E620830 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 130915B3C; Mon, 21 Oct 2019 11:48:28 +0200 (CEST) Received: from foss.arm.com (unknown [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id F2F154CA7 for ; Mon, 21 Oct 2019 11:48:26 +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 8400446A; Mon, 21 Oct 2019 02:48:17 -0700 (PDT) Received: from net-arm-thunderx2-01.test.ast.arm.com (net-arm-thunderx2-01.shanghai.arm.com [10.169.40.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2E17D3F718; Mon, 21 Oct 2019 02:48:13 -0700 (PDT) From: Gavin Hu To: dev@dpdk.org Cc: nd@arm.com, david.marchand@redhat.com, konstantin.ananyev@intel.com, thomas@monjalon.net, stephen@networkplumber.org, hemant.agrawal@nxp.com, jerinj@marvell.com, pbhagavatula@marvell.com, Honnappa.Nagarahalli@arm.com, ruifeng.wang@arm.com, phil.yang@arm.com, steve.capper@arm.com Date: Mon, 21 Oct 2019 17:47:53 +0800 Message-Id: <1571651279-51857-1-git-send-email-gavin.hu@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561911676-37718-1-git-send-email-gavin.hu@arm.com> References: <1561911676-37718-1-git-send-email-gavin.hu@arm.com> Subject: [dpdk-dev] [PATCH v8 0/6] use WFE for aarch64 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" V8: - define wfe() and sev() macros and use them inside normal C code (Ananyev Konstantin) - pass memorder as parameter, not to incorporate it into function name, less functions, similar to C11 atomic intrinsics (Ananyev Konstantin) - remove mandating RTE_FORCE_INTRINSICS in arm spinlock implementation(David Marchand) - undef __WAIT_UNTIL_EQUAL after use (David Marchand) - add experimental tag and warning (David Marchand) - add the limitation of using WFE instruction in the commit log (David Marchand) - tweak the use of RTE_FORCE_INSTRINSICS(still mandatory for aarch64) and RTE_ARM_USE_WFE for spinlock (David Marchand) - drop the rte_ring patch from this series, as the rte_ring.h calls this API and it is widely included by a lot of components each requires the ALLOW_EXPERIMENRAL_API for the Makefile and meson.build, leave it to future after the experimental is removed. V7: - fix the checkpatch LONG_LINE_COMMENT issue V6: - squash the RTE_ARM_USE_WFE configuration entry patch into the new API patch - move the new configuration to the end of EAL - add doxygen comments to reflect the relaxed and acquire semantics - correct the meson configuration V5: - add doxygen comments for the new APIs - spinlock early exit without wfe if the spinlock not taken by others. - add two patches on top for opdl and thunderx V4: - rename the config as CONFIG_RTE_ARM_USE_WFE to indicate it applys to arm only - introduce a macro for assembly Skelton to reduce the duplication of code - add one patch for nxp fslmc to address a compiling error V3: - Convert RFCs to patches V2: - Use inline functions instead of marcos - Add load and compare in the beginning of the APIs - Fix some style errors in asm inline V1: - Add the new APIs and use it for ring and locks DPDK has multiple use cases where the core repeatedly polls a location in memory. This polling results in many cache and memory transactions. Arm architecture provides WFE (Wait For Event) instruction, which allows the cpu core to enter a low power state until woken up by the update to the memory location being polled. Thus reducing the cache and memory transactions. x86 has the PAUSE hint instruction to reduce such overhead. The rte_wait_until_equal_xxx APIs abstract the functionality of 'polling for a memory location to become equal to a given value'. For non-Arm platforms, these APIs are just wrappers around do-while loop with rte_pause, so there are no performance differences. For Arm platforms, use of WFE can be configured using CONFIG_RTE_USE_WFE option. It is disabled by default. Currently, use of WFE is supported only for aarch64 platforms. armv7 platforms do support the WFE instruction, but they require explicit wake up events(sev) and are less performannt. Testing shows that, performance varies across different platforms, with some showing degradation. CONFIG_RTE_ARM_USE_WFE should be enabled depending on the performance benchmarking on the target platforms. Power saving should be an bonus, but currenly we don't have ways to characterize that. Gavin Hu (6): bus/fslmc: fix the conflicting dmb function eal: add the APIs to wait until equal spinlock: use wfe to reduce contention on aarch64 ticketlock: use new API to reduce contention on aarch64 net/thunderx: use new API to save cycles on aarch64 event/opdl: use new API to save cycles on aarch64 config/arm/meson.build | 1 + config/common_base | 5 ++ drivers/bus/fslmc/mc/fsl_mc_sys.h | 8 +- drivers/event/opdl/Makefile | 1 + drivers/event/opdl/meson.build | 1 + drivers/event/opdl/opdl_ring.c | 5 +- drivers/net/thunderx/Makefile | 1 + drivers/net/thunderx/meson.build | 1 + drivers/net/thunderx/nicvf_rxtx.c | 3 +- .../common/include/arch/arm/rte_pause_64.h | 26 ++++++ .../common/include/arch/arm/rte_spinlock.h | 26 ++++++ lib/librte_eal/common/include/generic/rte_pause.h | 93 ++++++++++++++++++++++ .../common/include/generic/rte_spinlock.h | 2 +- .../common/include/generic/rte_ticketlock.h | 3 +- 14 files changed, 163 insertions(+), 13 deletions(-) -- 2.7.4