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 43EF7A04AA; Tue, 8 Sep 2020 16:52:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0B4022BAB; Tue, 8 Sep 2020 16:52:20 +0200 (CEST) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by dpdk.org (Postfix) with ESMTP id 3B6D5DE0 for ; Tue, 8 Sep 2020 16:52:18 +0200 (CEST) Received: by mail-pj1-f47.google.com with SMTP id s2so8145851pjr.4 for ; Tue, 08 Sep 2020 07:52:18 -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=3/j+YCjguWrMGBHrmDxnjqW/tjkGKsEEhU2o/AHve/4=; b=Fcq68un5JiHMptAepJd2zkRyukRhD0FzovqKXbSgkf/Dp6gsh7MTtCiYWJn45h5R0k BmQw4cdh3qFAXRyN5SxeMkaqNYnx4/pPw5UoG4hXz2xV2o7FIkq4EClmYQ++5t8VZw/F ipY41Pic69oWRwZdVNjM3Osq2NsQRLwk3rWuYYhg69yeuDl4KtMpkIPpoXrDogxlzO6i S9E/3ZNDkgr4af9ylbdtnfMGpjEjVYFQ85WnWSQT9x6sPr9gp1qx7FIGNnX0vnvd51Xz 0fiVYjLE1cGD+ckawhKNom35mkGaRxLynD9Gm2Rn169rY9UeJHZHwvgKMnjHCYHt4UsT 4ZTg== 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=3/j+YCjguWrMGBHrmDxnjqW/tjkGKsEEhU2o/AHve/4=; b=AEPyzfFvYhxYUXACOqic+HglrypDXiWqnEVqQmjf2NZI1OBEwGHYR8e6AAD8qgekfo +LQOjAvrAK0kabD3gArlXnkDQGDgLwlsa6C5xILQWjyNqt2qo2Tu9K0fVmWqxsubHzga OwxOwkVAIyZorIOWbN3Apl7frHrE1Dm4kJ20YsdpepfvQsZrlneytpj/X++jOB7AR9vI 1J+HLvPJbmRNuPGDIwoMqHCqFzkMOctH2wQ/oBO5IfVtiLPuGHdwv8Xsk2lzqu0P4mnp rYw4lFLczvLSdiJnIRW9VsGdPMx43bB4yUGV8z+C/Gq6U/S0yjWFS6WKbnFDBJ9RPvKq MkxQ== X-Gm-Message-State: AOAM5320WpnbyO0gtibFyE9GRKT3zO1x1AIhCoeZMtzjW85GYqdSpIsp oURf4X4h5QshswxODDXaxqPlIg== X-Google-Smtp-Source: ABdhPJxXbo1ERRc2gPXozNHBR4PbxJtG9Qzb0qzvhWOuF/ysaKxS86Gjv2n//3D3LfuRili3OGSuqg== X-Received: by 2002:a17:90b:100f:: with SMTP id gm15mr4139148pjb.235.1599576737189; Tue, 08 Sep 2020 07:52:17 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id v4sm15286432pjh.38.2020.09.08.07.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 07:52:16 -0700 (PDT) Date: Tue, 8 Sep 2020 07:52:08 -0700 From: Stephen Hemminger To: Suanming Mou Cc: Ori Kam , John McNamara , Marko Kovacevic , Matan Azrad , Shahaf Shuler , "Viacheslav Ovsiienko" , NBU-Contact-Thomas Monjalon , Ferruh Yigit , "Andrew Rybchenko" , "dev@dpdk.org" Message-ID: <20200908075208.048bfa02@hermes.lan> In-Reply-To: References: <1599108782-230624-1-git-send-email-suanmingm@nvidia.com> <20200903103739.1d1b4b0e@hermes.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC] ethdev: make rte flow API thread safe 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 Mon, 7 Sep 2020 02:36:48 +0000 Suanming Mou wrote: > Hi, > > Sorry for my late reply due to the vacation. > > > What is the performance impact of this for currently working applications that > > use a single thread to program flow rules. You are adding a couple of system > > calls to what was formerly a totally usermode operation. > Read the source for glibc and see what pthread_mutex does > If I understand correctly, in the non-contended single thread case, pthread mutex lock should not go to the kernel space. > I also wrote a small application with pthread mutex, and strace shows no system call was introduced. > > Another simple testing code below is to check the cycles cost difference in every round between pthread mutex and spin_lock. > Micro benchmarks of locking is hard to see.