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 E2823A0545; Wed, 25 Nov 2020 15:17:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A40B6C962; Wed, 25 Nov 2020 15:17:05 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 800A8C940 for ; Wed, 25 Nov 2020 15:17:03 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 0B2125C016A; Wed, 25 Nov 2020 09:17:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 25 Nov 2020 09:17:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= wp87V6H+of+Xq+b1fDkkrE+pf9RaaRJRdp+OviMpsG0=; b=HlBsr6ZXTRsZIz/I /b7oIDBs+WJGeYokNcmpBrAHXTeD8Bie90n3cqLL4r+0oHBRFWsXJs5XlwB37Wog hC7JC+QEuWW1GO8uaV1tQd48oUnK/yzrYKqen+s67mYC7oTJwKNXAIPI+AQhikvf vv4FHhXRJs6CiYYJcwDD2UkrG38HbMYgR5W4GAVT8P0HHcthl/JWRLpeDyvTPvHl FaqBsarKMzQ18lg7weN3pKYt9AZIU6394WYxaHC8DNwMJC8JPy/Vf2MywEerqDtR kuN2Icx9uCedJ4Ne3DcZq21ok1e2eGQJo5+1A4wyK0IIVG+g98MMz1DoTMGH40cu 2/kJNA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=wp87V6H+of+Xq+b1fDkkrE+pf9RaaRJRdp+OviMps G0=; b=SWFspuIAeqQwsFWLzZ+kurWy/GLdnyJFFZZwQkCahLzaDxbz7gUGXXqHy JyPebAT53uaRb8TBRdhPnHJ0RhAEs9NC0J0shL742bNnm7UHF33dDClFOkIgSM40 107Sqye0D88XS7s6dCc6RUc1mQLoHrLCfNIN9U8eglG5CYOT74Xj4mjVDJgobvlV fK4MX/EqjLEnJhpoMeOJF+nW4/JTRd4HKy4wIAmj5LZU6yyvUd91YK6AeKtpAQgD VToOHCw2f3x5FDaIsyzcvAGhzE+mU1mn5/t2B6t2ERuoZf++vAn+tWIcmuGnlOeL Gh6gs9yOinSWgCuHMzy0D0R4ACEqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudehtddgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 0C7723064AB3; Wed, 25 Nov 2020 09:17:00 -0500 (EST) From: Thomas Monjalon To: Diogo Behrens Cc: "david.marchand@redhat.com" , dev@dpdk.org, Honnappa Nagarahalli Date: Wed, 25 Nov 2020 15:16:59 +0100 Message-ID: <2959194.bmkqA6hyfk@thomas> In-Reply-To: References: <20200826092002.19395-1-diogo.behrens@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] librte_eal: fix mcslock hang on weak memory 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" > > The initialization me->locked=1 in lock() must happen before > > next->locked=0 in unlock(), otherwise a thread may hang forever, > > waiting me->locked become 0. On weak memory systems (such as ARMv8), > > the current implementation allows me->locked=1 to be reordered with > > announcing the node (pred->next=me) and, consequently, to be > > reordered with next->locked=0 in unlock(). > > > > This fix adds a release barrier to pred->next=me, forcing > > me->locked=1 to happen before this operation. > > > > Signed-off-by: Diogo Behrens > The change looks fine to me. I have tested this on few x86 and Arm machines. > Acked-by: Honnappa Nagarahalli Applied, thanks