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 1D14EA0503; Thu, 31 Mar 2022 11:22:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A94E1410FA; Thu, 31 Mar 2022 11:22:57 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1DE2840DF6 for ; Thu, 31 Mar 2022 11:22:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648718576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=36k9Lk93zFlNbP6DR7rWNAM/H0RWSBGpO0qK+RbTweY=; b=QMTTiWk6iCiYzXrNDMPS8L3G3kr9APixD6XsKaq5Y6AZ1NjacIqnT8/1pTmTDB/8RJnJ66 OoXUuy9dCHFnr/Y+/b+icKnwH/M8ys16zn0ZrzTQw078VNAZPgRKj86CwBMpmnG4CKL7pD 7fx0O7grTNObKeZLkn86N1FSaRVgmPE= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-345-FF24zz8qPma5IBnaQP4Qow-1; Thu, 31 Mar 2022 05:22:54 -0400 X-MC-Unique: FF24zz8qPma5IBnaQP4Qow-1 Received: by mail-lf1-f70.google.com with SMTP id z39-20020a0565120c2700b0044a219505a4so7286008lfu.11 for ; Thu, 31 Mar 2022 02:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=36k9Lk93zFlNbP6DR7rWNAM/H0RWSBGpO0qK+RbTweY=; b=VCASCVRtfWchetlH39sz9tlMi+wyZrZOIbPb5c61UnH1aBfavZxG9tIfZwCjiomBBv pA2g/gDbjahTQtBT3QcROotOowRXYrRGjOYYrjDFjPz9zACXS/xh14VdXV6wy15Clgsy dua9XTlzqK0ABHL9IrzOyEr/rgS1yuDCgIovyEalxoLiXhFiDEytq2Fr/5FJ1Oy1wG+K GeLoRFs4swUH1e+NT7UpiIBb93cSzQB/sc2kslPF/srxg89jCFBDeGL21oXeAjjQ1GVK Retb0PqUQjWRSSLRyfjjb1JzlE7dMPimYyqmeqswlhHT0ewDMxvGQhf4HY3oWqGxkgA9 WbsQ== X-Gm-Message-State: AOAM5321rPCHIZhqhybxjk8ijTk+peA3utGjKXxBiPl2nDanuz+pY208 G/Ay4MN/AljIPqBQJnJ0SOPRkevU1aHn1+t6lnJCU2BjyObM/5xFAzAsxt2kJXZSflHZRyZd3RM 4W/czcXlEcgExftht05k= X-Received: by 2002:a05:6512:1281:b0:44a:b492:5e7 with SMTP id u1-20020a056512128100b0044ab49205e7mr9521198lfs.265.1648718573366; Thu, 31 Mar 2022 02:22:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdSkUYWsJH/SwCAVj/sRx+90eYO6CoShnbOwqXhaHXlFG8X/h7NHO6SYO1dTNivt75QtraYM2KxfHf2n9wIO8= X-Received: by 2002:a05:6512:1281:b0:44a:b492:5e7 with SMTP id u1-20020a056512128100b0044ab49205e7mr9521185lfs.265.1648718573161; Thu, 31 Mar 2022 02:22:53 -0700 (PDT) MIME-Version: 1.0 References: <20220328121758.26632-1-david.marchand@redhat.com> <20220330134956.18927-1-david.marchand@redhat.com> <20220330134956.18927-3-david.marchand@redhat.com> In-Reply-To: <20220330134956.18927-3-david.marchand@redhat.com> From: David Marchand Date: Thu, 31 Mar 2022 11:22:41 +0200 Message-ID: Subject: Re: [RFC PATCH v2 2/9] eal: annotate spinlock and rwlock To: dev Cc: Maxime Coquelin , "Xia, Chenbo" , Jiayu Hu , "Wang, YuanX" , Xuan Ding , Ruifeng Wang , Jan Viktorin , David Christensen , Bruce Richardson , Konstantin Ananyev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Wed, Mar 30, 2022 at 3:50 PM David Marchand wrote: > diff --git a/lib/eal/include/generic/rte_rwlock.h b/lib/eal/include/generic/rte_rwlock.h > index da9bc3e9c0..dabbac0131 100644 > --- a/lib/eal/include/generic/rte_rwlock.h > +++ b/lib/eal/include/generic/rte_rwlock.h [snip] > @@ -90,7 +92,8 @@ rte_rwlock_read_lock(rte_rwlock_t *rwl) > */ > __rte_experimental > static inline int > -rte_rwlock_read_trylock(rte_rwlock_t *rwl) > +rte_rwlock_read_trylock(rte_rwlock_t *rwl) RTE_SHARED_LOCK_TRYLOCK(1, rwl) Should be 0. > + RTE_NO_ANNOTATED_LOCK_CHECK > { > int32_t x; > int success = 0; > @@ -114,7 +117,8 @@ rte_rwlock_read_trylock(rte_rwlock_t *rwl) > * A pointer to the rwlock structure. > */ > static inline void > -rte_rwlock_read_unlock(rte_rwlock_t *rwl) > +rte_rwlock_read_unlock(rte_rwlock_t *rwl) RTE_LOCK_RELEASES(rwl) > + RTE_NO_ANNOTATED_LOCK_CHECK > { > __atomic_fetch_sub(&rwl->cnt, 1, __ATOMIC_RELEASE); > } > @@ -134,7 +138,8 @@ rte_rwlock_read_unlock(rte_rwlock_t *rwl) > */ > __rte_experimental > static inline int > -rte_rwlock_write_trylock(rte_rwlock_t *rwl) > +rte_rwlock_write_trylock(rte_rwlock_t *rwl) RTE_EXC_LOCK_TRYLOCK(1, rwl) Should be 0. > + RTE_NO_ANNOTATED_LOCK_CHECK > { > int32_t x; > -- David Marchand