Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1466301lqm; Thu, 2 May 2024 16:25:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJEipdPds0R7M2vkF57q9acmryEToxDuYCxKVIZCyNMGXUiSlndIdnZZPBbInZ3sOd1XDapmWoGEAE1ttsFlexOgAgdy9ePt7VURmnKw== X-Google-Smtp-Source: AGHT+IGimLBhJV/PQNR3g2gx9EU2LNBPZZ0ebSxLM+/5N/W2J2iyFrRu4JaxVM0CL/t87/Lqs0av X-Received: by 2002:a05:6a00:18a6:b0:6f0:c828:87ef with SMTP id x38-20020a056a0018a600b006f0c82887efmr1190666pfh.3.1714692304597; Thu, 02 May 2024 16:25:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714692304; cv=pass; d=google.com; s=arc-20160816; b=jg1VaFnXnQnpROxxW9had5ureC2lV5Ojw+5qg0HoFWCZaQSpkqb8fth/PcK/G24Qkn bPac5dkrkm2OfFXGbpz6MekmWCXKIrPdRVxk8GSEm9lQw3oRV11ab6dysAUZ/feoyJ6t g3Lga6jtwLBrWaZYlJpK+3eENCiD7hYrbtAhMR3VHY2jNdWafhfVwEV/G7Vh/198v/9v 0qi3xpdbbXWRd6b03Yhx9tPG6J8xDIfhQC/nh5PScNTA8YKPMp27cyhyCG7MMYI0TS7X B8OVf43mKgwB2W2OLhVLlzk9n1GvC18zzyjdQviyW8II0k3rMEB+qgbW3xDy9prlJM1w moSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=i6JN4J2gFuUHV5idXz05AtG9Y1hW4HX4gS5b0NVqQAg=; fh=RuhjTyppLu95P0Hq1Ocywi6LmE5L4QKlRSAmuCkzM4k=; b=tY7/jwU+j1WYVck8zCUELv0Pxfa+e1kLw40oIrt6suaROt+I1Jf9XjHatq2tzkHFBA 4OtgiMDQxrJqbrgRu9+IDfb4tAWmfia9Ob86TkmTw0IHf3CBI0NTS/XO9o4SHk4QB0ys 9PKdbMueg5/E/TchbQBQG7S/Yipp7I8eBPsf6+FGJayLP23TXZHCwDrttCVxSJK8wT8A kSspOk135L1FOVT/PkNnYxvsNIYuOwDgEGHO4SDrnDcABt73CJ2fbefqtf4c8QG2r76+ 3MLXrl7OFIi1ubrz4PYjWXnt8G4JBuHgKeWV26FBA8QmRyWDdc+nkq/oMUTPsQsIkcti iCnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=YJ8thX4O; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-167057-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167057-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ca21-20020a056a02069500b005f7fed86319si2020550pgb.166.2024.05.02.16.25.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 16:25:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167057-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=YJ8thX4O; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-167057-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167057-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3AA2128212C for ; Thu, 2 May 2024 23:25:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56F0020322; Thu, 2 May 2024 23:24:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="YJ8thX4O" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (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 B315E57C96; Thu, 2 May 2024 23:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714692297; cv=none; b=l2jZDpKvNabBJ4wCntzouwEAudDSy4rBUp/cicqmyqMqtsR2UsfJffnLVNTCNEPZcQTEKDu3xyNOMZtkaJDF7yVaOgbzSsy8r5NS4VfJP5w0arx4C1r8TQ6/WukDvoTB9FQeXSFs+Z0sxlfaITk+9pPWqyBI28Axx5jjT/51mRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714692297; c=relaxed/simple; bh=+xXyzedyVc48PF3hdyhKkxKsf7uulASRUcLk9rMpso8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DJaYYeOiTfyxH02FYVkwZmJdyp4V4O3o3Im/CH4HEBWZnOsIt08tzlAW2+l82Fx1RrR1bnLIKwMmziYnpGvztgBUQ8GAA/1y6QrwdjAx1OLqWLPXuiGt//xEvDJbN5VTz3fxz3ep0b6WOWBUPTG51j9dQSar66yvpDExGVOLrNo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=YJ8thX4O; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=i6JN4J2gFuUHV5idXz05AtG9Y1hW4HX4gS5b0NVqQAg=; b=YJ8thX4O/ALhTWziBUFMmV8YCH maFFLbdIt0u12R2wdolpQIpNqeQ1aUhuZ0ZutCMc7u88GcEzII1dS/+7/xr+ru9B5vUiiYNRZ5qil kxjtigSee/d3iVR2GMykTjSNSTrcLLT4nlJ7ubZyxJ4ynz6QJ3MGTtEqPY/8pKuddlnrUhC7A3h3x H9E8asOqGV/KkNW8YxR03I+jXWWcPBu6w/s6HMzADolIJaSAdfed0zdYfkQtERMV2ToPAL9cpOpux DnKRcLgwKnBtNduWU56QU9YY0qMCjp57/0j+E2U3Oc+9we3T1FVZPPwhxeVElFRMGEu/P319o/XFn XtveEmOQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1s2fnD-009rGh-0p; Thu, 02 May 2024 23:24:47 +0000 Date: Fri, 3 May 2024 00:24:47 +0100 From: Al Viro To: "Paul E. McKenney" 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: <20240502232447.GO2118490@ZenIV> 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> 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: <3dac400c-d18f-4f4e-b598-cad6948362d6@paulmck-laptop> Sender: Al Viro 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...