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 89AD6A04B5; Wed, 30 Sep 2020 21:15:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 94E3E1D57D; Wed, 30 Sep 2020 21:15:14 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 0E9DA1D57C for ; Wed, 30 Sep 2020 21:15:11 +0200 (CEST) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601493310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=d4Fz5Jm5Grhe1mlYO6nR7C5KfALnn9MxhZV7jLBSUnY=; b=KZVMmR2nhwJZxvrj5jo8KYytBdgNGlzmY54/SV36AR7/NeXxVLse8Ebx2uyvOiMqM+bFvg mFNA4Sj0rFoV3pS2qLMl8a2ourVhFl2bg3+G89rkTt9jAF4TTRemrr6fhGnUzLQRw0om/M 4lczx9f0VC1ja1yvU39g5fKpcyIVWUg= Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-TGn3JFdcPmSEDBSQPd7Kfg-1; Wed, 30 Sep 2020 15:15:08 -0400 X-MC-Unique: TGn3JFdcPmSEDBSQPd7Kfg-1 Received: by mail-ua1-f71.google.com with SMTP id w16so1025838uau.21 for ; Wed, 30 Sep 2020 12:15:08 -0700 (PDT) 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=d4Fz5Jm5Grhe1mlYO6nR7C5KfALnn9MxhZV7jLBSUnY=; b=J5BDF/C8yuAUAYC++EH4/xTwDob9uj5t4uX1gnMsAotsE6MFfBUJlgukpOVudI1RoJ 4OMlQqLqYSFcXritoY9bWEh7pxmf0NiM4koRTwmNsyCibLZ7Yum8kxzdtiRW6eXcCtBQ 8LBEEslTUXHAaRxa2S9RgNxE5lFyQfqetPySyQn6W87S7pesMBQNLWFTXFt6+XLcBGBh wj6+mtyrYkF+xyDwygoFcTVngOgVUfV2qY1uVthOKeZNyfqhwXzFXD5mPr9OLGgtjY3Y VOdajMF64rvw7bPYroPDcsxRbFOpIbKqUgjFHwfPeFmOVaoDs7zmH2Hhkx9p5aTq+76Z bt9w== X-Gm-Message-State: AOAM5317ArkpFRKObe8bD8mJW54n+NwFCZiKdX741NMtANzl4KDFtz1T +xKRyU7LV3k3eYMXdVQhfg3bktNGC9pTQHdg/nmoAzBaP8a9WnOYv6PQ9rQUB0lDSHbZfmMVPvW 0xzCL0iczoY9xba937jo= X-Received: by 2002:a67:fd44:: with SMTP id g4mr2875542vsr.18.1601493308082; Wed, 30 Sep 2020 12:15:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGyfUH9LRapBQ+b7JzbSvoT9Ri3+gxixVIMQi+UF3u6JxOzpuWZx8PTS2ZRFuZbO/XV4SObIpMuqQXVXNCLQc= X-Received: by 2002:a67:fd44:: with SMTP id g4mr2875524vsr.18.1601493307829; Wed, 30 Sep 2020 12:15:07 -0700 (PDT) MIME-Version: 1.0 References: <20200911152938.8019-1-steven.lariau@arm.com> <20200925174340.10014-1-steven.lariau@arm.com> In-Reply-To: <20200925174340.10014-1-steven.lariau@arm.com> From: David Marchand Date: Wed, 30 Sep 2020 21:14:56 +0200 Message-ID: To: Steven Lariau Cc: dev , nd , Dharmik Thakkar , "Ruifeng Wang (Arm Technology China)" , Gage Eads Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 0/5] lib/stack: improve lockfree C11 implementation 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 Fri, Sep 25, 2020 at 7:44 PM Steven Lariau wrote: > > One implementation of the DPDK stack library is lockfree, > based on C11 memory model for atomics. > Some of these atomic operations use unnecessary memory orders, > that can be relaxed. > This patch relax some of these operations in order to improve > the performance of the stack library. > > The patch was tested on several architectures, to ensure that > the implementation is correct, and to measure performance. > Below are the results for a few architectures on multithread stack > lockfree test. > The cycles count is the average number of cycles per item to perform > a bulk push / pop. > > $sudo ./builddir/app/dpdk-test > RTE>>stack_lf_perf_autotest > difference compared to main > Cycles count on ThunderX2 > 2 cores, bulk size = 8: -15.85% > 2 cores, bulk size = 32: -04.56% > 4 cores, bulk size = 8: -05.00% > 4 cores, bulk size = 32: -04.35% > 16 cores, bulk size = 8: -02.38% > 16 cores, bulk size = 32: -01.88% > > difference compared to main > Cycles count on N1SDP > 2 cores, batch size = 8: +00.77% > 2 cores, batch size = 32: -16.00% > > difference compared to main > Cycles count on Skylake > 2 cores, bulk size = 8: -00.18% > 2 cores, bulk size = 32: -00.95% > 4 cores, bulk size = 8: -01.19% > 4 cores, bulk size = 32: +00.64% > 16 cores, bulk size = 8: +01.20% > 16 cores, bulk size = 32: +00.48% > > v2: add comment to explain why pop head CAS relaxed is valid > added Fixes information > > Steven Lariau (5): > lib/stack: fix inconsistent weak / strong cas > lib/stack: remove push acquire fence > lib/stack: remove redundant orderings for list->len > lib/stack: reload head when pop fails > lib/stack: remove pop cas release ordering > > lib/librte_stack/rte_stack_lf_c11.h | 32 +++++++++++++++++++---------- > 1 file changed, 21 insertions(+), 11 deletions(-) Series applied, thanks for those optimisations. -- David Marchand