From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22272A0547; Fri, 29 Oct 2021 15:56:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BE9441136; Fri, 29 Oct 2021 15:56:27 +0200 (CEST) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) by mails.dpdk.org (Postfix) with ESMTP id BCAFD410E1 for ; Fri, 29 Oct 2021 15:56:25 +0200 (CEST) Received: by mail-il1-f175.google.com with SMTP id 3so10693009ilq.7 for ; Fri, 29 Oct 2021 06:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KlhTX+sTnlxf+aMEOd+KrGbSSbX4atzuKsBkm/VENos=; b=gSc4Y9VeNS43psWtFZ/JYmfXFPx+xk+OPVZo8I9zT13qc1QZMBz4mg0nTK8ih45Prx lfQqTfF5MDGifROGV2cJeAuo7lmgHUYdOWsnpF2l/aRICOxifIR76jala9KNNmkGRV/x pHsIT/zyk0aNUqntjU7sBrMya/2JNcCLEE/vLRrKYy8Fva7lbdvzKTWWZC6a4H6EJK5F Fr0TPGw3azQOZmZ9CCz9zjr6EX9x8VB5B+YlWyBg5MPimacQMx+VKl6h7yoV6ZkkooyB HxTSSKb3yknIffQb0rrtOTTXAHyRrt1b2UqwaofHyJvGfCmRtABrDfZdAU203Ti3m85R jybQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KlhTX+sTnlxf+aMEOd+KrGbSSbX4atzuKsBkm/VENos=; b=vclYRSJN7ZWjDT4jxPmQRZjLTZpnkv/LJ+DEuwK8TfQgeFCX/ZJysxpVlZo1MnKQHN qTQagCKKq/2vAYdTejImbMdpCARSZr6pGnIILRHSFdcXAzEU3gtV9VBpHOT/Y2s8otws wpSZTm09+UbrHmak+SMoMwcHbePwUELUdSzYSIRjFoSS15L3OIPeZZQISfXqL9x0by56 tDkh1dFGQ0mgWLEc8Xdcd+EQBhDlH68xyHSytrKJa/FZJdGLyzwwPlPw93S/+RzL8WFw /efkN5+/5nt/QZA+r0rMmO7rfQon20K68jeQJzGoUaifx0Fc8XAlfHJ/bxicBVEyZezR vxfg== X-Gm-Message-State: AOAM530lrEJwqOhGnpEqXgm1sRje8GTYL4I449kHhz4q+JZDynFsLdH9 yDkxed9bmLVdE6dDJkYtpFzCCu3F2lNWbcrfUZ0= X-Google-Smtp-Source: ABdhPJynSLAKS2JNhop44+mp2f0Qg7FbuEZA3f+cECdDGy+KTA6lM9DMmHAz18NmrsSUwZ+n9c14pgtuUdwRKiI3eF0= X-Received: by 2002:a05:6e02:174d:: with SMTP id y13mr7829117ill.251.1635515785131; Fri, 29 Oct 2021 06:56:25 -0700 (PDT) MIME-Version: 1.0 References: <20210902053253.3017858-1-feifei.wang2@arm.com> <20211029082021.945586-1-feifei.wang2@arm.com> <20211029082021.945586-4-feifei.wang2@arm.com> In-Reply-To: <20211029082021.945586-4-feifei.wang2@arm.com> From: Jerin Jacob Date: Fri, 29 Oct 2021 19:25:59 +0530 Message-ID: To: Feifei Wang Cc: Honnappa Nagarahalli , dpdk-dev , nd , Stephen Hemminger , David Marchand , Thomas Monjalon , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , "Ananyev, Konstantin" , Ruifeng Wang Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v8 3/5] eal: use wait event scheme for mcslock 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" On Fri, Oct 29, 2021 at 1:50 PM Feifei Wang wrote: > > Instead of polling for mcslock to be updated, use wait event scheme > for this case. > > Signed-off-by: Feifei Wang > Reviewed-by: Ruifeng Wang Acked-by: Jerin Jacob > --- > lib/eal/include/generic/rte_mcslock.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/lib/eal/include/generic/rte_mcslock.h b/lib/eal/include/generic/rte_mcslock.h > index 34f33c64a5..b4e07648ff 100644 > --- a/lib/eal/include/generic/rte_mcslock.h > +++ b/lib/eal/include/generic/rte_mcslock.h > @@ -116,8 +116,9 @@ rte_mcslock_unlock(rte_mcslock_t **msl, rte_mcslock_t *me) > /* More nodes added to the queue by other CPUs. > * Wait until the next pointer is set. > */ > - while (__atomic_load_n(&me->next, __ATOMIC_RELAXED) == NULL) > - rte_pause(); > + uintptr_t *next; > + next = (uintptr_t *)&me->next; > + rte_wait_event(next, UINTPTR_MAX, ==, 0, __ATOMIC_RELAXED); > } > > /* Pass lock to next waiter. */ > -- > 2.25.1 >