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 4A80DA00BE; Tue, 28 Apr 2020 14:23:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C71751BF8E; Tue, 28 Apr 2020 14:23:09 +0200 (CEST) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id B04741BF84 for ; Tue, 28 Apr 2020 14:23:08 +0200 (CEST) Received: by mail-io1-f65.google.com with SMTP id k6so22566229iob.3 for ; Tue, 28 Apr 2020 05:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AMVzhjM2Jwp9pdxbvgkG2lXkufxGFhPcZskteH5Anpc=; b=ion3NujPLxI93Zjp/CQMuSZvg1UMVcI/ArwnfbDrXUsXDt2Y4B1/sma+jCvZbdOHkL mqNKFtFCI/ixkcWJfpR53sXe+fVcS5BEDHeWK2w16MogcahLR0spzuIkP/a4I8Psh+vN dMqshfl/oAW8Yx0d3VHf6cIeR+tUeE39WATUOKm5vW1jXd9PWbaEcR5jGuRU6NfcGkP1 8DkMU4X5a7wC/Lrl6sF5hEOnA+q/M3VOPq5fq6eQJGN8jVKXcSfahlf4AVsXTOzr9NaO CivkJgh2fPEj/U55HDL2kyqWWxB3brB+QyDb3fNXKcxG90ljn1uZy+2tUqnLQmkTU/7U PYkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AMVzhjM2Jwp9pdxbvgkG2lXkufxGFhPcZskteH5Anpc=; b=smMr8cbdP6n/x5dXFkFu4+zuviJg61tZcTkrAYNPrujhxnussi31l18wtRKK90doQ6 Q6ZzTiuI0r02qbWg3Lujxm8waZzuPr6gLERZzOKpqXmUZV/yrLlUDfAa9SoCaLjpCweS CZW+2OVYuTLOd9K1r3fQPQ/667MRYqT8V+J1vnPzrpu9Nr8tgpbV3QG/KxBoOKyLfWLJ URQbNrgZFXOdhqxWhZVeQ7sd7/UIWhY9bnNjJ+W8kfxoDuwgQ9RdJqHhAgtUSyVDDOOt yeJ92wkHoeNS4KZmgiiRw9/2demzHPW+Uimq97W8pTXPEKHRiHP+3x9xl1jdPODC3k1g Lf/Q== X-Gm-Message-State: AGi0Pub96eRI6APBdCwEm+9/3sk4hEuyzWYFhuPq1AxKVQLJ437a4O33 sO35HHRrX2mzOVPV932MQenJH60tEJOlhTLXYl0= X-Google-Smtp-Source: APiQypLn/dc8j+cyPoD2X5OafBtK5VtgxwMnGBLniqCRTVxntCIQgDIsizXDdL8B00JxP9Utwy3jFnJpVjPx9eca0cw= X-Received: by 2002:a05:6602:21c6:: with SMTP id c6mr25189008ioc.163.1588076587736; Tue, 28 Apr 2020 05:23:07 -0700 (PDT) MIME-Version: 1.0 References: <20200424070741.16619-1-gavin.hu@arm.com> <20200426083909.897-1-gavin.hu@arm.com> <20200426083909.897-2-gavin.hu@arm.com> In-Reply-To: <20200426083909.897-2-gavin.hu@arm.com> From: Jerin Jacob Date: Tue, 28 Apr 2020 17:52:51 +0530 Message-ID: To: Gavin Hu Cc: dpdk-dev , nd , David Marchand , Thomas Monjalon , Jerin Jacob , Honnappa Nagarahalli , "Ruifeng Wang (Arm Technology China)" , Phil Yang , Joyce Kong Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 1/2] spinlock: use wfe to reduce contention on 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" On Sun, Apr 26, 2020 at 2:09 PM Gavin Hu wrote: > > In acquiring a spinlock, cores repeatedly poll the lock variable. > This is replaced by rte_wait_until_equal API. > > Running the micro benchmarking and the testpmd and l3fwd traffic tests > on ThunderX2, Ampere eMAG80 and Arm N1SDP, everything went well and no > notable performance gain nor degradation was measured. > > Signed-off-by: Gavin Hu > Reviewed-by: Ruifeng Wang > Reviewed-by: Phil Yang > Reviewed-by: Steve Capper > Reviewed-by: Ola Liljedahl > Reviewed-by: Honnappa Nagarahalli > Tested-by: Pavan Nikhilesh Acked-by: Jerin Jacob > --- > lib/librte_eal/include/generic/rte_spinlock.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/include/generic/rte_spinlock.h b/lib/librte_eal/include/generic/rte_spinlock.h > index 87ae7a4f1..40fe49d5a 100644 > --- a/lib/librte_eal/include/generic/rte_spinlock.h > +++ b/lib/librte_eal/include/generic/rte_spinlock.h > @@ -65,8 +65,8 @@ rte_spinlock_lock(rte_spinlock_t *sl) > > while (!__atomic_compare_exchange_n(&sl->locked, &exp, 1, 0, > __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) { > - while (__atomic_load_n(&sl->locked, __ATOMIC_RELAXED)) > - rte_pause(); > + rte_wait_until_equal_32((volatile uint32_t *)&sl->locked, > + 0, __ATOMIC_RELAXED); > exp = 0; > } > } > -- > 2.17.1 >