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 762D1A0093; Tue, 8 Mar 2022 22:36:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15EED40395; Tue, 8 Mar 2022 22:36:10 +0100 (CET) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mails.dpdk.org (Postfix) with ESMTP id CFC0B40141 for ; Tue, 8 Mar 2022 22:36:08 +0100 (CET) Received: by mail-lf1-f46.google.com with SMTP id w12so309226lfr.9 for ; Tue, 08 Mar 2022 13:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TOcDlddlUT2IsXhi133QgEj74gqQBTIxIK2Ahf6aAS4=; b=nheLCS1XlqCqUxKcL8R16cPltAWZllg8VaRfuGTAvzvIC2NKxcixMKT0ulWer6n7cS kQOuIG6B4qLuhLI0QV8hNEz6N/ISTEW82NpCirLTS6vLma/mnkcxo1y6VzBvFeyRs3D4 PcYhfjSmagjTByhYxhIDGoC1Zv/sfsW7H8YyFnM8sSypSkzpXWEthxcGCKJLwZ4KZEGv 6lrud7sWSV9A5ef8VQuT+RF0HRA/zpiBBMPOF8Gs6Wjx90j9UkTGohv/DyFL9P3mnU3B sEgvlGvQSpuktBvJvUhZZBk5PuVAtUmwg83E0aM9CAEhf7TB1c5A08+jKXEI1NJILxPp cOQA== 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=TOcDlddlUT2IsXhi133QgEj74gqQBTIxIK2Ahf6aAS4=; b=ZANDP6oIvuTDfJ3pJOj3DtwqyQrdjtYqvrpL4ROyFAG8ujiDWrDCv7tOrcmdxs13K9 0xbQrniEe6pNckJ2yt/+lKDv/fndpXDC4ox3WmsqemFsuyyR16NPbRdH+08eumFH2Yf0 r36yNQTpknMmD47dbx9nGvgPd11f4bF8vk58qI5zq+fwJst574h/UBPwa5WMZJuMU7Cq lPXU+CSMRtVM6WxJS+oVcphehXaEBbQfTG4dk3u77ExcQZtklYt/lSiWC8MF9BRQ0n64 vBhmS4wn48iyxu62iim7zu9zWLPmtQ8kJYg9LdTexHbEr4YEG2qGx3xulCtkYS6sNQRJ 30Fg== X-Gm-Message-State: AOAM530AdDfEJVa8uv2Fh3J5G0CzP+dOBhKaMlUiC0pX3jlnmtQ+9cS1 dCBByOhTeliXtqe9K239eN4= X-Google-Smtp-Source: ABdhPJyqESbmlyj6pzD/LY6QU9naEozSN+vQEkqPyJapPx7YxFTfSsvbZkTVpYpTHaOWzJN4X6YlAQ== X-Received: by 2002:a05:6512:33c6:b0:446:e0ce:5c3c with SMTP id d6-20020a05651233c600b00446e0ce5c3cmr12716063lfg.26.1646775368330; Tue, 08 Mar 2022 13:36:08 -0800 (PST) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id m27-20020a056512015b00b00445b827ccf0sm3702719lfo.236.2022.03.08.13.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 13:36:07 -0800 (PST) Date: Wed, 9 Mar 2022 00:36:06 +0300 From: Dmitry Kozlyuk To: Stephen Hemminger Cc: "Ananyev, Konstantin" , Narcisa Ana Maria Vasile , "Richardson, Bruce" , "david.marchand@redhat.com" , "dev@dpdk.org" , "dmitrym@microsoft.com" , "khot@microsoft.com" , "navasile@microsoft.com" , "ocardona@microsoft.com" , "Kadam, Pallavi" , "roretzla@microsoft.com" , "talshn@nvidia.com" , "thomas@monjalon.net" Subject: Re: [PATCH v18 8/8] eal: implement functions for mutex management Message-ID: <20220309003606.001bbacc@sovereign> In-Reply-To: <20220224094457.1e6721d8@hermes.local> References: <20220209024755.GA9377@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20220221005605.3c11746e@sovereign> <20220223200854.29910906@sovereign> <20220224094457.1e6721d8@hermes.local> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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 Hi Stephen, 2022-02-24 09:44 (UTC-0800), Stephen Hemminger: > There seems to be some confusion here: > pthread_mutex put thread to sleep if contended and on linux are built on the futex system call. > pthread_rwlock are the reader/writer versions of these. > > The DPDK has primitives for multiple types of locks: spinlock, rwlock, ticketlock, pflock, etc > these are build using atomic primitives (no syscall). > these are platform independent > these spin if contended > > Not sure about Windows, but it looks like slim rwlocks came from Windows NT and are an implementation > of the same kind of spinning lock DPDK already has. Both CRITICAL_SECTION and SRW lock spin shortly before going into kernel, but both do this eventually---SRW lock is not a purely user space primitive.