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 56AB642BAD; Sat, 27 May 2023 00:16:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC61C40A7A; Sat, 27 May 2023 00:16:01 +0200 (CEST) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTP id 491A2406A2 for ; Sat, 27 May 2023 00:16:00 +0200 (CEST) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-5289cf35eeaso1925651a12.1 for ; Fri, 26 May 2023 15:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685139359; x=1687731359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=gSuoWir4BIi7r276Qsewd2XiiKObi2IAoiuCd0Daf94=; b=k2YQGJJBi5yH9e74lHeJoVGMM1RTU6+/ooHDGTz/exbKqujtBE1mwvwel5UDPdfp3q Bl8M7Anmopy9KvcSGXoj5LNL4gdH2rJSB8LZleHkAFGHwXUu8bacB6MRDYPkYGbCmS05 nLVh8+/DKSAIjOONc4JJovPTRW59KqaWVLwwQYh9kIdDqRme30oJfweu3poAES3McIqB +oTpBmcxMuVlFHrimQMwTFDTnRNwBoD9+reMKQStWk+DDMNwLkBubF53RHprHL4kTtOK +oP+Da0/jGD8VeMXEA9+A5/zAW4YQ7zeEpBibq558pyd7LeKYOoykcQMnOw/uXu/S0PG NOjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685139359; x=1687731359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gSuoWir4BIi7r276Qsewd2XiiKObi2IAoiuCd0Daf94=; b=f2LVgHl8CGwUL1l6V2lvuPCD9eJTJnvlXMqjrSQRsdlLtGX4JZR8SpM0hiMNCFuoG5 /qE7uSAqc76m/bKNicPjt5pm022bFsFEwYJvV4k83TiKnjWDVjgIn/ktCNERPnooY0xT e5Ewf0p8Hv7lVLFeo/NdFmcY/djbSY7kGb5oUxuT178muOwEvZNHkLLOlKA9/UM/yjPt jLvSmCOdfgMjxTSAwksw3C2dWz096xJ27uidM8XwaN6OfhjzwJNQAn0dJQyt0th/ccnC 9NJstOL4kUkROf2PZaQTTsZSVGLDlVc10THklk/bQHiNq1Xqg7xBN3Zq2Xi9qxw42Sy7 /DDA== X-Gm-Message-State: AC+VfDzRHWS5RonSlmFT5IEbaOnbB0YoyP9inm7oCP7s6Jq5VoPOrNZn j77j52fryvGC8IDZngGY1l9UDQ== X-Google-Smtp-Source: ACHHUZ5bROsO73wbyGVek3N2M/bzvI1oC1A/Trsj+d/4+wGWueMUKx2cWvqJK+6kIailkoNgNhTc7Q== X-Received: by 2002:a17:903:2350:b0:1a6:f93a:a136 with SMTP id c16-20020a170903235000b001a6f93aa136mr528191plh.22.1685139359365; Fri, 26 May 2023 15:15:59 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id b5-20020a170902e94500b001a2104d706fsm3693391pll.225.2023.05.26.15.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 15:15:59 -0700 (PDT) Date: Fri, 26 May 2023 15:15:57 -0700 From: Stephen Hemminger To: Anoob Joseph Cc: Thomas Monjalon , Akhil Goyal , Jerin Jacob , Konstantin Ananyev , Volodymyr Fialko , Hemant Agrawal , Mattias =?UTF-8?B?UsO2bm5ibG9t?= , Kiran Kumar K , , Olivier Matz Subject: Re: [PATCH v4 21/22] pdcp: add thread safe processing Message-ID: <20230526151557.5aff9c1c@hermes.local> In-Reply-To: <20230526210214.617-22-anoobj@marvell.com> References: <20230524160116.304-1-anoobj@marvell.com> <20230526210214.617-1-anoobj@marvell.com> <20230526210214.617-22-anoobj@marvell.com> 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 Sat, 27 May 2023 02:32:13 +0530 Anoob Joseph wrote: > + /* Lock to protect concurrent updates */ > + rte_rwlock_t rwl; > /** Bitmap memory region Reader/writer locks are significantly more expensive than simple spin lock. Even uncontended access requires additional cache update. Unless there is case with a long region where lock is held, just use a spin lock. See some Paul McKenney's locking talks (LCA video is good) about lock overheads in Linux. Since DPDK has same set of instructions to use; the same issues apply to userspace.