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 9C9A9A0540; Mon, 4 Jul 2022 18:41:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47C7C400D7; Mon, 4 Jul 2022 18:41:22 +0200 (CEST) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id DE9CA40042 for ; Mon, 4 Jul 2022 18:41:20 +0200 (CEST) Received: by mail-pf1-f177.google.com with SMTP id 128so9361727pfv.12 for ; Mon, 04 Jul 2022 09:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zdPgmiboiJ6bA7CjHLGg/ykqSdXALc0Y+8751vvnh5w=; b=AbA6roZqizGfVTS7+Srry1NwQRKwU7P7Jo2LldOTnr1cf/iy0iTyfJ8dcQeDCstopT YJVpZis+EXxB/vwHHmNvAxWw/5Dero86Z7lioeiFeMTveGma0t0e3vWo/iYRDTPtBtEZ RjZTBgcwny2IdKE1eT7CEM/OhSXHZo6rswcXzE/Jy/VGipwvpUh+/YZ0tVgYxME70YG/ nLFu2XklMJCjTmWUWBuEXFyv3AZIzGinf6NtWnDfTys+6n/YrXnVTjupqZL9ZxyYr+l8 /aE/XUuem3nsOyRddU5KugurG8q8M4okjkkq7BZ5l09uRVrIFD1Do1Hq/bCN6zWsYYIl tv6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zdPgmiboiJ6bA7CjHLGg/ykqSdXALc0Y+8751vvnh5w=; b=7upQdEr8gBg9Skct9hasfE2v0zPWKf9BTUgKTt5k8/+8ImHz/0feY/irGyt/JbLBcK y3F5aVGO669XUZ1uy5kT+nBDlQ1RA9CRYSPyoxsN/fyC51nAYsfgcutDxcxOByfNxzzp rPm/Epu57j51KHE2nXXv3Ewa2/LPLQcuS6SzGRh0RSlZCBLzSqdouTH5aspjyq3XoMbo NT9Gkk8i3r8/ajYm0vOUfbGNFGJN2XqClQKVZVomU/UIeN3Oc4yO7mtPNlEv5Q6Kbufo 0AH+O+Dp/hqr9FNuwT1a2IiAtDDBlmxRja9T/GUuDtPmEzaRuy6OEp+hJynzG9FIlBL/ /A8A== X-Gm-Message-State: AJIora88A3nXMutE1PrqyGSlAIZGJyURyYiIFjBR2MEBStkh4GqrYXnE 4nG8vkEKLY2DXdSQ204RnGSKYA== X-Google-Smtp-Source: AGRyM1uwCRmfLgRy+bgyZdOJ4ktkgV0T6JGkfgqkKyvyma7jBJf0ai6JDZThUL34E6c01ZZO21/Qhw== X-Received: by 2002:a63:164e:0:b0:411:ce18:5532 with SMTP id 14-20020a63164e000000b00411ce185532mr18273651pgw.55.1656952880112; Mon, 04 Jul 2022 09:41:20 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id x5-20020a1709029a4500b001678e9670d8sm21562513plv.2.2022.07.04.09.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 09:41:19 -0700 (PDT) Date: Mon, 4 Jul 2022 09:41:17 -0700 From: Stephen Hemminger To: Long Li Cc: "longli@linuxonhyperv.com" , Ferruh Yigit , "dev@dpdk.org" , Ajay Sharma , Stephen Hemminger Subject: Re: [PATCH 01/17] net/mana: add basic driver, build environment and doc Message-ID: <20220704094117.340d9b46@hermes.local> In-Reply-To: References: <1656666167-26035-1-git-send-email-longli@linuxonhyperv.com> <1656666167-26035-2-git-send-email-longli@linuxonhyperv.com> <20220701094736.7d7589b5@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Sun, 3 Jul 2022 07:56:18 +0000 Long Li wrote: > > Subject: Re: [PATCH 01/17] net/mana: add basic driver, build environment and > > doc > > > > On Fri, 1 Jul 2022 02:02:31 -0700 > > longli@linuxonhyperv.com wrote: > > > > > + uint64_t max_mr_size; > > > + rte_rwlock_t mr_list_lock; > > > +}; > > > > Reader/Writer locks are slower for the usual uncontended case. > > Unless you have a reader holding onto the lock for a long time, better to use > > spin lock. > > > > This is Linux wisdom (thank you paulmck), Windows seems to love reader/writer > > locks. > > This lock is used mostly uncontended for readers and allow them concurrently to access the list. It's rare that a writer might want to access it. > > But changing it to spinlock will prevent multiple readers from accessing the list at the same time. In this use case, is it beneficial to use spinlocks? https://www.researchgate.net/figure/Costs-of-Simple-Spinlock-and-Distributed-Reader-Writer-Spinlock-To-write-acquire-the_fig1_244490342 Conclusion Breakeven curves for the locking primitives were computed, and the breakeven between simple spinlock and distributed reader-writer spinlock supports the rule of thumb that states that simple spinlock should be used in cases where the update ratio f is greater than the reciprocal of the number of CPUs, 1/nm.