Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp29805lqb; Tue, 4 Jun 2024 04:13:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNML0MsYP2XpN7DIbyq1tcTKG6MwlU4zltrd7v+tnrEbnbQq7koywtyzVnsvZpXUgfN1DVcWkqoNBejZvOfkmiBKLiTmMrJqbBu34avQ== X-Google-Smtp-Source: AGHT+IG6+LKuP/vNS+I2pks2oowtnvihkuBWP25R/aVszpQIwQN7Eiz8QoropUYND3+f9N3iMZnm X-Received: by 2002:a50:d5dd:0:b0:578:5245:3296 with SMTP id 4fb4d7f45d1cf-57a364480e7mr7138240a12.28.1717499632331; Tue, 04 Jun 2024 04:13:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717499632; cv=pass; d=google.com; s=arc-20160816; b=xGDR6cg0bZgMtEWzTJmthA1ukbpssP5s7fEnS+EmM246vFRRJe61d6dKH0ihNezWNT 4pknCgwUMaKP2Bsim8Pgckc2h3yZ3NQzNAFtOrzX/i5JDN0UCNzKUVSXbtd7+phPhclh dqu2ylpiaZ9y7ZNlgzEg0t2UiVhX4aLQVJi98Ctbn3HNekBrTcVGoAFIUivrtXRO0GAK bXA81sCnSv5RkJAY5svc3qfkyblUPON0TiPCuto2zS1bwRwYhjSoPNGyBf0XklHsIYoQ LCf4YuXWHT2r4pml9OEp8b8azVKABcaksEbe+Bs8il9vvH7mrhk6PFLbzNs71D5ZFkO3 1I4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P+Y1HXJGLVb443nKXHHXr9hbeqBHlN6NVpu5ulpYQr0=; fh=CKO8u3a5Ns8hrFAAgYwEuPoDNvwaoFiyxN7o7XuYTjM=; b=Psn5FW/VM8JK0itUmtXXTj4HsaZIkzhcf+ouP+FvjoHhQd/U8EkRHBYHdTnaUXSmGQ hmrxxpe6xSNulJQ3OQfMBD+9ltgIEsFaYWJVOemqkMXU1VojZi+bdgs6gVr9VDPVLOK6 IX0IQirxU/E7J6xLNLsX9E0jHjPirNghc9VWt28lIw2f1gu+V1ffQhIAM6S1CCtvzPjL RVdELF1wPLgfijKV1zzLkOkLpjcBAKjUPYfSRrbkcIHY5M4nCtoz2/7ozU2E9S8OcNZ4 pnWKHvseHjMa3I9UA9R1Kd6eFeQ/MaX/OM+gi6AIHnxUfhgNjgAXern3g7lvhoyO2QZX /g2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fso+L++o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-200493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31c6375fsi4993354a12.256.2024.06.04.04.13.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 04:13:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fso+L++o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-200493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 026721F22962 for ; Tue, 4 Jun 2024 11:13:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFF2D145A10; Tue, 4 Jun 2024 11:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fso+L++o" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 021331420D7; Tue, 4 Jun 2024 11:13:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717499609; cv=none; b=mQN+RfukTrSIj4yG184Z8tkUWXZaLK0USwAcmPgtV2axFhR8SMrj8enBmIoD3GxqlgBo6nhmVzaxs+L7J4FNF47U7e23tCFdFCwBJBEUAwLbwv9YOoO9Bf0ByX6uAAQy/C5RXsVNa76GAAUDHVNbMF4dtSNC26gt39o6DORp1fA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717499609; c=relaxed/simple; bh=G4bcdfSkhr9b1oEzgL3rS01ajLXZ3Z5wtjM+zkVc240=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iORFApmKL8KN5lbvTiRqx6dcZYIpnbDiSPELvmvWJYkoN677lpLJCjiv547iJ3StBcZgEvA7I0o5/290xMl7xK3fRyzQBnZQAQV/TRThqVeJ7cz0FjBb4TLlggYhvJmqfLM3AZ8p9pnYq6y8AP6a/12YihWfjCz6TKcI11fL0l8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fso+L++o; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C17EC2BBFC; Tue, 4 Jun 2024 11:13:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717499608; bh=G4bcdfSkhr9b1oEzgL3rS01ajLXZ3Z5wtjM+zkVc240=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fso+L++ob6iiEnRG2ve+9AvufqnkHrJQ4v2N/L9WAYC6CeCfOYLb6QIlyE+/4F/2I jAnKkEsBgwy43qLzJJe+lPBw+5vxsRxPfdrdvIiUHxDsi73HkWxyZNx8nB/nXoIY9Q hKl2Ifq3lN/h/aLEc1RfcZ+UMo8rXnwA3lX+i4BxKLnHVUtKeE6prhp7ibO/Hx+Q9T yTzVRcHScq7Uezq4xZWIRgkZ4fPrQyZkK+cuUCf1Ogoi5purO2x1ZY86suQZmj8fhv CvxJVbPQoCNCn/A8QWVv/4Xx05rBltVQdWzBmwMj1yLgLr1oqXKPb3ZuinzHO+mu4s lOVwwoTzXwcsw== Date: Tue, 4 Jun 2024 13:13:25 +0200 From: Frederic Weisbecker To: "Paul E. McKenney" Cc: LKML , Valentin Schneider , Boqun Feng , Joel Fernandes , Neeraj Upadhyay , Uladzislau Rezki , Zqiang , rcu Subject: Re: [PATCH 5/6] rcu: Remove full memory barrier on RCU stall printout Message-ID: References: <20240515125332.9306-1-frederic@kernel.org> <20240515125332.9306-6-frederic@kernel.org> <5bc2d72a-ae27-43f0-893e-afb202abd61b@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5bc2d72a-ae27-43f0-893e-afb202abd61b@paulmck-laptop> Le Mon, Jun 03, 2024 at 05:10:54PM -0700, Paul E. McKenney a ?crit : > On Wed, May 15, 2024 at 02:53:31PM +0200, Frederic Weisbecker wrote: > > RCU stall printout fetches the EQS state of a CPU with a preceding full > > memory barrier. However there is nothing to order this read against at > > this debugging stage. It is inherently racy when performed remotely. > > > > Do a plain read instead. > > > > This was the last user of rcu_dynticks_snap(). > > > > Signed-off-by: Frederic Weisbecker > > I went through all of these, and the look good. Though I am a bit > nervous about this one. The RCU CPU stall warning code used to be > completely unordered, but the hardware taught me better. I did not > add these in response to a problem (just lazily used the existing fully > ordered primitive), but you never know. At least I haven't found against what it is ordering the dynticks counter here. > Me, I would have kept the extra > memory barriers in all six patches because they are not on a fastpath, It is still time to discard the patches :-) > but you are quite correct that they are redundant. Yes and it's not so much for optimization purpose, like you said it's not a fast-path, although in the case of fqs round scan it _might_ be debatable in the presence of hurry callbacks, but I use those changes more for documentation purpose. My opinion on that being that having memory barriers when they are not necessary doesn't help reviewers and doesn't bring the incentive to actually verify that the ordering is correct when it is really required, since there is so much of it everywhere anyway. I'd rather have a clear, well visible and precise picture. But that's just personal belief. > > So I have queued these, and intend to send them into the next merge > window. However, you now own vanilla RCU grace-period memory ordering, > both normal and expedited. As in if someone else breaks it, you already > bought it. ;-) Sure, but it's a bet. That one day a younger person will buy it from me double the price ;-) Thanks.