Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1473245lqm; Thu, 2 May 2024 16:45:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtHvidhRQZfpluTnS/lwTmz1JQri3qjQUoTwQySi7M1qXvCxngJhixFLFTDT1qIWp/54xeDjfN0Vfp7LlHUQ+vlkvHLCGo5428CHPBtA== X-Google-Smtp-Source: AGHT+IEoD+7TRKQoXO2dZBvOSdb3OddsdmuUS6dvEV/K3g+c8EgOnI0zLa6P07tzRehNzbGReahQ X-Received: by 2002:a05:620a:bc8:b0:78d:6479:7c39 with SMTP id s8-20020a05620a0bc800b0078d64797c39mr1304609qki.19.1714693538635; Thu, 02 May 2024 16:45:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714693538; cv=pass; d=google.com; s=arc-20160816; b=Emot3GGlynPQ5mXjj6sRN5rmxPeS/CbrtcXRxB7F+pIJK0PQ7emkLvt/vEb+H/7mm6 rf4shGEcMUTkBK2YWEoa4LWEuG35zPd2GhG3UgJyRl3VSVCeK6Si/NaCS/FGAe8F4Fdm So8WJ7Hayc9homyu+q05sI2ia+/y/Gyo1uX3lqNWLzr3LpgJbSqULMHyQxyAf1J2pQl5 CQC0LJr9FeMvbAwUXdGVKEMXGaxMJzUBPg0AKoEIEGcTe8CnsxTxZLSqO9XmkMeLYND9 sSYq/Ifi0QVlgA3ouRFAT1RaJckj5mftuBwKlNmJl1WNExe4Pb994aV4+CqzwA1CfTEW Fz+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=+wV0uGLpgVyAfkkhtRBfeDWjQql6dsLr6zQJJ7rGBho=; fh=zAPYh1UeyTzQsjkaTKcX1v2JK7j9pipq3fFBln4yugs=; b=zVSXLpsTf+p1pISHQeBY18wCZ8Ub91Q24eNvrXV6qMqIcixIyOkBf1z/kAysQWwUA9 bsx3MdCz5y/GxfjMeX1u8xbU8W7mYuTUGo3I3dJtBtgwZZ8pXAdmxy5ew/71ftKaKsUE NIVXcUihCA6UUhiWnNxc8Dm0+EecahGbE/9bf/Vlfw+thomfmCQ0QP6+slnOz3ai3nGS NEdMMwYM+LbHUjIOXMAEzvRQyefhZO/PBa3oYTcDBysnf6b0VFj534BU59t5nN9c/0v8 nc5efcyxefG06b08o3+PLvFjRQDhSDfOHWmKzSV7KtYkKORVtV9Cn0765vyNzjcPdX1J qnWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tjbde47B; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167077-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167077-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z24-20020ae9c118000000b0078ec44f70bdsi1948183qki.279.2024.05.02.16.45.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 16:45:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167077-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tjbde47B; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167077-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167077-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5BB231C2316F for ; Thu, 2 May 2024 23:45:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FBD6158A1C; Thu, 2 May 2024 23:45:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tjbde47B" 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 7EF6920B20; Thu, 2 May 2024 23:45:30 +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=1714693530; cv=none; b=o+IgPlRmcFywY6yVTJ+n9bsF4R9zOOApLXG9hfL4Z/draKisiUJI1WoADtzcdKI8t/OEJ0hOhxaDombStzZHY6XTXHh+FvNajsX1QO9xUuGwt5YHehUykCZYRr7NXJLfCKQFkc9iVf+yCfT0a07r+JEYBoJLYA2qdxxJgOagNj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714693530; c=relaxed/simple; bh=FSWB1xnA+87vQFSU9PyW5P5MFuSUupDK1oeWvd3K+Rc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BLAmj6U4HKfRVfWOgu1m50SACEx6LTpuQuXAxgWSVZANd6Yma2eHKPuUqurOUVdTdp/wCJSco/4DobPT6QZXxl++sdar9Zispphm+4E9b1ur5RMCN5ZdLtTgFGBFE8aXy2c+4e2qEIzcgilKW4ZkN3eS0ojjkximP63oJGzTG7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tjbde47B; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04705C113CC; Thu, 2 May 2024 23:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714693530; bh=FSWB1xnA+87vQFSU9PyW5P5MFuSUupDK1oeWvd3K+Rc=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=tjbde47BGZ/LniOxo+HAxqo60qpsPQm9BXyHOxx4v2nLpZqvWtS3jZnAYOplMUbxn N8x6DY0HPe0ywU7Kh/4RvRMTnhJzJEeIB6eXvHsAJgsecHCgt/LlJcGElWuqZpZhCq ouzNLzdthaTG1Zkcn/Vh/OhA//36MgJzN6jlDVeGr9y3axX/7LYFFvINwfz3vQ9ClB C2wkCheO9J1pgClNPvXWSZ3ovUtAw/pTRChCeHyt6yTDAYsAi7WVCnsZM/+lU3+pzM pKDi7sLB2WXhkNuxZHQwUrJcaB1cUspiwnZuS8uybzdJ/hlaTAZIYNAY8D3+KlWxf7 EzMJStNyBCBVg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 97FB8CE0991; Thu, 2 May 2024 16:45:29 -0700 (PDT) Date: Thu, 2 May 2024 16:45:29 -0700 From: "Paul E. McKenney" To: Al Viro Cc: John Paul Adrian Glaubitz , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, elver@google.com, akpm@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, dianders@chromium.org, pmladek@suse.com, arnd@arndb.de, torvalds@linux-foundation.org, kernel-team@meta.com, Andi Shyti , Palmer Dabbelt , Masami Hiramatsu , linux-sh@vger.kernel.org Subject: Re: [PATCH v2 cmpxchg 12/13] sh: Emulate one-byte cmpxchg Message-ID: <9b0acc4c-6ba9-4743-bad7-2baa1e29b085@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20240501230130.1111603-12-paulmck@kernel.org> <1376850f47279e3a3f4f40e3de2784ae3ac30414.camel@physik.fu-berlin.de> <6f7743601fe7bd50c2855a8fd1ed8f766ef03cac.camel@physik.fu-berlin.de> <9a4e1928-961d-43af-9951-71786b97062a@paulmck-laptop> <20240502205345.GK2118490@ZenIV> <0a429959-935d-4800-8d0c-4e010951996d@paulmck-laptop> <20240502220757.GL2118490@ZenIV> <3dac400c-d18f-4f4e-b598-cad6948362d6@paulmck-laptop> <20240502232447.GO2118490@ZenIV> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240502232447.GO2118490@ZenIV> On Fri, May 03, 2024 at 12:24:47AM +0100, Al Viro wrote: > On Thu, May 02, 2024 at 04:12:44PM -0700, Paul E. McKenney wrote: > > > > I'm probably missing your point, though - what mix of cmpxchg and > > > smp_store_release on 8bit values? > > > > One of RCU's state machines uses smp_store_release() to start the > > state machine (only one task gets to do this) and cmpxchg() to update > > state beyond that point. And the state is 8 bits so that it and other > > state fits into 32 bits to allow a single check for multiple conditions > > elsewhere. > > Humm... smp_store_release() of 8bit on old alpha is mb + fetch 64bit + replace > 8 bits + store 64bit... Agreed, which is why Arnd is moving his patches ahead. (He and I discussed this some weeks back, so not a surprise for him.) For my part, I dropped 16-bit cmpxchg emulation when moving from the RFC series to v1. Thanx, Paul