Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1141582lqm; Thu, 2 May 2024 06:33:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVgKATfU5kh7imngu1KzozfQleWForVVsX6nIEEQeZ1JcBlQvkVsh0jLi8LVXk8kQ8Ug1+/f2waNtpPZbOu7EXo2GDEk7S4V3V8oJklNg== X-Google-Smtp-Source: AGHT+IF40m6n5hszugTXLZD0w/kyaVk7kIF1h7u+QT6aJsLSXlkN/ir4BYBO5xWJLeTngwXWGzGF X-Received: by 2002:a17:906:c7d6:b0:a52:cc77:5a25 with SMTP id dc22-20020a170906c7d600b00a52cc775a25mr3659363ejb.67.1714656838683; Thu, 02 May 2024 06:33:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714656838; cv=pass; d=google.com; s=arc-20160816; b=JqOdANgQQDbziW9Q0VplmDTT1zhxjADLXkshPvFIit39irR4aUbPcRawKxuf5EenFH fypLLs7iWrYkt6A7wzx7t9hkt4Mca1VG2nRY0m2wKgC2lqeWgzs/7g6/E2ODZnJsG7yE W8H98LxolteKfXIHCNOLKU79TtOGVJmiTkhtOGBskdRwbe+4/SD9YkPc4VaD7X7OMNHh P0h6i3cq0DX8YjQA+joyxL01cAUOsb2m9P4MN4d2kYvVkUeYXpQYuS3dWRRmXJX7lH56 3kdaIE5ksLdsfgXuw86u+/+ly23wNB4iGdTjYsM7SSq6rDGMNl8uoT8saV9ruM0UFlH7 n8xg== 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=wTiMRtrpN/RoKRBYnzplO+wyIc0F+JxlI3zQSbLS/gw=; fh=9YlKqQu2QdLurYpvQdaLG6ISAxR01C7HLMr9lbFwQp4=; b=xfCBbtTX8XanzUEHmWjTvrgKAkfWK+cd0zbFgtBvC/GbGCIIPwr55o/5EbvQ3XBXy6 psJm/u321hVXVqYIguPihqngAp82IPf0gGqyqaEoolYumH+rmU4/3F7ROAZ6Fw+p/XfS ATtG1hA8zlwbaew1kOCNUUw5dPzme6cat7DxcDe+VCLTP0zHqoDEzHKQ5L27op4Aok6Z CTE1VUofHYz1TFRJG1f5EhiWJyWqTyDFZaHVCvTuVVV98Njy2e1UjUPZRKtT4S7zMx6l tpgVlS7BeJwzLIF8LoIhf/rsXGNR5ngnczEsknyqD87V5SsSyMuQupWKsaZaBoeJ48vg JiIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qhp54mU9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-166511-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166511-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 he7-20020a1709073d8700b00a587300ebdasi581005ejc.472.2024.05.02.06.33.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 06:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166511-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=Qhp54mU9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-166511-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166511-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 66B6D1F23382 for ; Thu, 2 May 2024 13:33:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94FC813C670; Thu, 2 May 2024 13:33:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Qhp54mU9" 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 B023B41C60; Thu, 2 May 2024 13:33:50 +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=1714656830; cv=none; b=PG4iO/alb6nPzWMp3c2e3A6WCYAhHw+eiVBK7/rQYKOXtKeYKFKHPwUmYkcL0q0diXGX5HuoQ9E10LXozWtvde+01569GgT0zX9OKCldjQKIlFRhv01KcQW/9s63hkWX7jg/mWrGO5fpnT9OF7mQNEDHzvbEjwANx8VCs26VlaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714656830; c=relaxed/simple; bh=/S7AtR8fKpgwqpaJ4A1qTHav5smcrL3bhTiibfOG55k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cLXDPxzg2PbhwjFaVTGHhkhjuQHkyyZgHIftSdTHiFTsCZme9VKRixPwmjL9meY1F20wwx4VU4mDaGvDttY8UyIF4rv/x6bpfm5bTQLzUzO8bJCKCeFN8gq35LOYGWtSe6er4ipMRIPxoI7pbaCZHSP8BbmE1NLySiM1LVofLVk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Qhp54mU9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20B42C113CC; Thu, 2 May 2024 13:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714656830; bh=/S7AtR8fKpgwqpaJ4A1qTHav5smcrL3bhTiibfOG55k=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Qhp54mU9jSSXO0Ilw5t8MMapJa5zcPhdM7R/X2INQGEYXTACs8zzcib5Rqs3EgxCj veRnIhxG15azWVufx1iZFF87MuXz+ByGER8OjVUnRC0e/V5c7xjc+Oa3c9LxcLRuYW LWxD6fVUp4TIpgBONS39StM80YhPGgF4nB9un5+oyTnXU8M0oKajjxTJH/eYpMv4tQ m7ILTBNi1VCcl4olk1JSxpTyffW8LsK3arQ5WIkP95XaRWDkZct6bjkUqqX1R3lksy RLIgtIsz/SnMo4CevZWIMUlTLSEFmm0Mf/uG+N/XEs5lREqxXHmZDErRU3z4jj+8Xu JZcthxNuirWRw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id BC0A6CE0A32; Thu, 2 May 2024 06:33:49 -0700 (PDT) Date: Thu, 2 May 2024 06:33:49 -0700 From: "Paul E. McKenney" To: John Paul Adrian Glaubitz Cc: 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: <9a4e1928-961d-43af-9951-71786b97062a@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> 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: <6f7743601fe7bd50c2855a8fd1ed8f766ef03cac.camel@physik.fu-berlin.de> On Thu, May 02, 2024 at 07:11:52AM +0200, John Paul Adrian Glaubitz wrote: > On Wed, 2024-05-01 at 22:06 -0700, Paul E. McKenney wrote: > > > Does cmpxchg_emu_u8() have any advantages over the native xchg_u8()? > > > > That would be 8-bit xchg() rather than 8-byte cmpxchg(), correct? > > Indeed. I realized this after sending my reply. No problem, as I do know that feeling! > > Or am I missing something subtle here that makes sh also support one-byte > > (8-bit) cmpxchg()? > > Is there an explanation available that explains the rationale behind the > series, so I can learn more about it? We have some places in mainline that need one-byte cmpxchg(), so this series provides emulation for architectures that do not support this notion. > Also, I am opposed to removing Alpha entirely as it's still being actively > maintained in Debian and Gentoo and works well. Understood, and this sort of compatibility consideration is why this version of this patchset does not emulate two-byte (16-bit) cmpxchg() operations. The original (RFC) series did emulate these, which does not work on a few architectures that do not provide 16-bit load/store instructions, hence no 16-bit support in this series. So this one-byte-only series affects only Alpha systems lacking single-byte load/store instructions. If I understand correctly, Alpha 21164A (EV56) and later *do* have single-byte load/store instructions, and thus are still just fine. In fact, it looks like EV56 also has two-byte load/store instructions, and so would have been OK with the original one-/two-byte RFC series. Arnd will not be shy about correcting me if I am wrong. ;-) > Adrian > > -- > .''`. John Paul Adrian Glaubitz > : :' : Debian Developer > `. `' Physicist > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913