Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64D1EC678D4 for ; Wed, 1 Mar 2023 20:20:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229480AbjCAUUB (ORCPT ); Wed, 1 Mar 2023 15:20:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbjCAUT6 (ORCPT ); Wed, 1 Mar 2023 15:19:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51CD11F4A3; Wed, 1 Mar 2023 12:19:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B213614B6; Wed, 1 Mar 2023 20:18:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1610C433EF; Wed, 1 Mar 2023 20:18:28 +0000 (UTC) Date: Wed, 1 Mar 2023 15:18:26 -0500 From: Steven Rostedt To: "Paul E. McKenney" Cc: Uros Bizjak , Joel Fernandes , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan Subject: Re: [PATCH] rcu: use try_cmpxchg in check_cpu_stall Message-ID: <20230301151826.014c5977@gandalf.local.home> In-Reply-To: <20230301200820.GF2948950@paulmck-ThinkPad-P17-Gen-1> References: <20230228155121.3416-1-ubizjak@gmail.com> <20230228160324.2a7c1012@gandalf.local.home> <20230228212911.GX2948950@paulmck-ThinkPad-P17-Gen-1> <20230228164124.77c126d2@gandalf.local.home> <20230228190846.79b06089@gandalf.local.home> <20230301113813.4f16a689@gandalf.local.home> <20230301200820.GF2948950@paulmck-ThinkPad-P17-Gen-1> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 1 Mar 2023 12:08:20 -0800 "Paul E. McKenney" wrote: > > Attached patch implements this suggestion. > > Please help me out here. > > Why on earth are we even discussing making this change to code that > normally never executes? Performance is not a consideration here. > > What am I missing here? Is there some sort of forward-progress > issue that this change addresses? Well, we sorta hijacked this thread. It turned into a more general discussion, as there is code that this change will be useful for (ring_buffer.c), but we just happen to be having the discussion here. Where it will at most remove some text and give you back a few extra bytes of memory ;-) But if we do use cmpxchg_success() IMHO, it does improve readability. > - cmpxchg(&rcu_state.jiffies_stall, js, jn) == js) { > + cmpxchg_success(&rcu_state.jiffies_stall, js, jn)) { -- Steve