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 F2907A0C3F; Sat, 3 Jul 2021 19:30:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7715740040; Sat, 3 Jul 2021 19:30:47 +0200 (CEST) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id EAA204003E for ; Sat, 3 Jul 2021 19:30:45 +0200 (CEST) Received: by mail-pj1-f54.google.com with SMTP id ie21so6881724pjb.0 for ; Sat, 03 Jul 2021 10:30:45 -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=eU51wSbrk0skLiHnV4LvgInyDz9+2t9SNi118IPJv2A=; b=X2x3J8JRZ6QHjll7U+7URqCc8oUBDts7pZzXQmKRmr3Aigc+XdmTq82hAs3gqqi6+b ZbMGGWXQ7fAps2N6xP6QcfHdhCqdLH+bg+kJqFKXWj0fNznXhStN40GMGD+KK58tfiMS XAWqtAHalfHXJ6ERBcAHTnOVh1lHHEz/BtlirHJvngst2wzeeSwThFex+P90WdijvGJE Pp+wzmLCW8ptrUoyIUSLvYD76sHcHQTIbBhoBGxbAxZ1cGKBeFVnirv0J+9wYoquDa/j 0pVw83UmAwOdCngInsVx6OQuI4ElNEUpT7m2adGwPdIlhTwow4kNn70ozonOZkZ4Pub8 V2bQ== 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=eU51wSbrk0skLiHnV4LvgInyDz9+2t9SNi118IPJv2A=; b=AI5W5o1oQTLnSRHLr10pzKi6uDBq2kLXmBKN77l2ord0WOEXf0XB7ObG7fjmaZVu7H Pru6k587YolZl0ZYk0A28I0c4cl4c/QmHqPJzkt9USdmZELZNep5GMv2+tWEdl+TjES5 KnQxm18OrJE77vC0OQOeHC5G0rCu7OFYIjE0P7ZvnD3yb2RCeFl68LBKzNNFRmV+YYdi Ylv1Vie1Bc9Bkpk9iKHa6wVYXvwQxGd7DqU3wul7q9IpU1eZuuIloEtqp+7I9jBmbToy A2FyNXotI+TVuyP+3/92NaxK7vX5R/ObBSVuVH5uTb9o6J0dAU6DBFvUUkN2A5qS5wUs 8qNA== X-Gm-Message-State: AOAM530rzWVChlcm33qp0Rvp3iu5I3j9xCL1EgSsdp/E+nMIv62dmgmY 25VKanL17HTJivG2Vzdo++xugw== X-Google-Smtp-Source: ABdhPJx824oQ4S05N3MA5bsIYZaM/Ku5dEvSpCWLJVPk6fMU3B/PhsSxJhRtchm6YgfEHnLoDmfiiA== X-Received: by 2002:a17:902:f682:b029:128:e54c:f58a with SMTP id l2-20020a170902f682b0290128e54cf58amr4840182plg.13.1625333444854; Sat, 03 Jul 2021 10:30:44 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id k189sm4342134pgk.14.2021.07.03.10.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jul 2021 10:30:44 -0700 (PDT) Date: Sat, 3 Jul 2021 10:30:41 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com, Phil Yang , bruce.richardson@intel.com, konstantin.ananyev@intel.com, dev@dpdk.org, david.marchand@redhat.com, David Christensen Message-ID: <20210703103041.31ee7456@hermes.local> In-Reply-To: <1879045.6WiRxTbeAL@thomas> References: <1879045.6WiRxTbeAL@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] atomic operations 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 Sender: "dev" On Sat, 03 Jul 2021 13:29:38 +0200 Thomas Monjalon wrote: > In the deprecation notices of DPDK 21.05, we can still read this: > " > * rte_atomicNN_xxx: These APIs do not take memory order parameter. This does > not allow for writing optimized code for all the CPU architectures supported > in DPDK. DPDK will adopt C11 atomic operations semantics and provide wrappers > using C11 atomic built-ins. These wrappers must be used for patches that > need to be merged in 20.08 onwards. This change will not introduce any > performance degradation. > > * rte_smp_*mb: These APIs provide full barrier functionality. However, many > use cases do not require full barriers. To support such use cases, DPDK will > adopt C11 barrier semantics and provide wrappers using C11 atomic built-ins. > These wrappers must be used for patches that need to be merged in 20.08 > onwards. This change will not introduce any performance degradation. > " > > Should we keep these notifications forever? > > It is very difficult to find which wrapper to use. > > This is the guide we have: > https://doc.dpdk.org/guides/prog_guide/writing_efficient_code.html#locks-and-atomic-operations > There are 2 blog posts: > https://www.dpdk.org/blog/2021/03/26/dpdk-adopts-the-c11-memory-model/ > https://www.dpdk.org/blog/2021/06/09/reader-writer-concurrency/ > > Basically it says we should use "__atomic builtins" but there is example > for simple situations like counters, memory barriers, etc. > Please who could work on improving the documentation? > > Maybe there needs to be a DPDK version of the infamous kernel documentation of memory barriers.