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 81DF9A051A; Sat, 20 Jun 2020 04:21:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5078F1BF7A; Sat, 20 Jun 2020 04:21:54 +0200 (CEST) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 084601BF78 for ; Sat, 20 Jun 2020 04:21:51 +0200 (CEST) Received: by mail-pl1-f194.google.com with SMTP id s14so650475plq.6 for ; Fri, 19 Jun 2020 19:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ErgGKxz/HuXJuVQQUo1kmP5Lc/54I3w45IQ+6Vv2HLo=; b=ZhLcFvF/6wiijhtJLebetnHkQ2QHjroMRdX+bPq1zzHlG+7CLYL/tGV+Y7fiEwXvnJ cGB4mBKpMF6RLBTDbNV9HP8I0owYX0l6MsLcWxqYqQ45D9L4Alt0f2hN+j+3blqYteAu MJEP+iXmSMrBH+QYdNXl8iGeAG3FsGLKGHNX8dx+4fukbG+RtRoZf8dx3KmYi46tgVwy m4HWeo3T9C9AkczaM6XctcIDi4Un9CFq+tPI5nRyK3hDJcJJZTKegifxz+wblw6Tn89W 9IzhCp8457d9TSGW/7TqkFiJJOJ5BHZFDXgL+MF0pLy0d+/v3WzVUJBocKk7N/4PyYLO h4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ErgGKxz/HuXJuVQQUo1kmP5Lc/54I3w45IQ+6Vv2HLo=; b=QgjbVTYFQAFhgImCxMcNKBTKSk69gYz4iPl3918/d4tf33xCKguUcGrEFl1Z0qqa0I 3Oer2yTtLJqE74B51hzTl3Ce9D7DXTZuRNixKsgFZK7svJhhP33HaG23DKmxIcu/tr5U QzkOD2Ad7U+HEr6uGa7nD2r+gfqaoVQdC9RAfI+L8slPUw6ZRJhU6My4hIt1DAU0E2gE cfpqsU5UNYCZaHIroHWkRUODshIIlCv8VSwNWClbfyeW3ix28sHAO8qV0yQcxb8k3TIa Uc3o5dzXvP/yP+wPTkDN/sjscGc3PK1ChchBU7kVqA5WWeHxo6NJA5ZN4MsyYVJXR+R8 KZPg== X-Gm-Message-State: AOAM5314yN+yF3xGFM/WEip81jCDGcQGxZVNo/BcuuumjnJiQd9kXdGp usrH/eVONBB3mujcDXC7mw/t+g== X-Google-Smtp-Source: ABdhPJwd1HdGlAOhe/7Hs3K6/ivpY4C0Tsm5xg1YhNczhrg63LM6UCHCsJEu3zt3bhctx8/7EgwGqA== X-Received: by 2002:a17:902:ab8d:: with SMTP id f13mr1180690plr.119.1592619710875; Fri, 19 Jun 2020 19:21:50 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id h20sm6904814pfo.105.2020.06.19.19.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 19:21:50 -0700 (PDT) Date: Fri, 19 Jun 2020 19:21:47 -0700 From: Stephen Hemminger To: David Marchand Cc: dev@dpdk.org, jerinjacobk@gmail.com, bruce.richardson@intel.com, mdr@ashroe.eu, ktraynor@redhat.com, ian.stokes@intel.com, i.maximets@ovn.org, Neil Horman Message-ID: <20200619192147.3925b4a6@hermes.lan> In-Reply-To: <20200619162244.8239-9-david.marchand@redhat.com> References: <20200610144506.30505-1-david.marchand@redhat.com> <20200619162244.8239-1-david.marchand@redhat.com> <20200619162244.8239-9-david.marchand@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 8/9] eal: add lcore iterators 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, 19 Jun 2020 18:22:43 +0200 David Marchand wrote: > + rte_rwlock_read_lock(&lcore_lock); I see you converted a spin lock to a reader lock. Are you sure this is a good idea, although conceptually faster, the implementation on most cpu's is slower than a simple spin lock. https://www.kernel.org/doc/htmldocs/kernel-locking/Efficiency.html If your code divides neatly along reader/writer lines (as our cache code does), and the lock is held by readers for significant lengths of time, using these locks can help. They are slightly slower than the normal locks though, so in practice rwlock_t is not usually worthwhile.