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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 80969C4338F for ; Wed, 25 Aug 2021 08:01:44 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 09DA060F21 for ; Wed, 25 Aug 2021 08:01:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 09DA060F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D1BF411C7; Wed, 25 Aug 2021 10:01:39 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id A0E31411C4 for ; Wed, 25 Aug 2021 10:01:37 +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 16D9D31B; Wed, 25 Aug 2021 01:01:37 -0700 (PDT) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.115]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 779873F66F; Wed, 25 Aug 2021 01:01:35 -0700 (PDT) From: Feifei Wang To: Cc: dev@dpdk.org, nd@arm.com, Feifei Wang , Ruifeng Wang Date: Wed, 25 Aug 2021 16:01:26 +0800 Message-Id: <20210825080127.495645-2-feifei.wang2@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210825080127.495645-1-feifei.wang2@arm.com> References: <20210825080127.495645-1-feifei.wang2@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v1 1/2] eal/common: use wait until equal API for tight loop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Instead of polling for mcfg->magic to be updated, use wait_until_equal API. Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang --- lib/eal/common/eal_common_mcfg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_mcfg.c b/lib/eal/common/eal_common_mcfg.c index c77ba97a9f..cf4a279905 100644 --- a/lib/eal/common/eal_common_mcfg.c +++ b/lib/eal/common/eal_common_mcfg.c @@ -30,8 +30,7 @@ eal_mcfg_wait_complete(void) struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; /* wait until shared mem_config finish initialising */ - while (mcfg->magic != RTE_MAGIC) - rte_pause(); + rte_wait_until_equal_32(&mcfg->magic, RTE_MAGIC, __ATOMIC_RELAXED); } int -- 2.25.1