Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1081214lqj; Mon, 3 Jun 2024 09:32:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV5tc3jzkWCur3NkZQzX4VswFZ0F53ht8J1gY6UM+uvr1s4eG5xb4yVT3QOQQTqV4oJHMbJknGCleryW2fSPPbIHM7Nxho1MjtgYQojrw== X-Google-Smtp-Source: AGHT+IGLDAjtfHAA9VAzpqwjTjHXrtWgscpEDhgYzw0MipzAV0kFQRHhevCn46b9GueJ2L8R80HT X-Received: by 2002:a50:d70d:0:b0:57a:192e:a9f4 with SMTP id 4fb4d7f45d1cf-57a363eb105mr7332911a12.5.1717432371589; Mon, 03 Jun 2024 09:32:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717432371; cv=pass; d=google.com; s=arc-20160816; b=VTU5ZGQlWBX1+J8d2Ix3cy1A2Yy7jIGfv2g0jhzU3qKqkp5ncXWpHuHQMqUttK1EAf gTGxDl5nprIB0U4WiC4scb9NumG1B3/+i/+kI8/A++HGBKCmxvYMgDdbPOhoy/gSqkDh izRlSkhHeR/paT9wsKxKanG9Zcvkzsb4Jk3dzunHxzS6fRgpd6ls5+OEnwABSESBQyg6 XaHrMQZD5R7a7IRA3FEcCtYiLerS8qgnDhElkgEbeQPtem850VJJjSrLA01XfiSkzd84 YvNKXPYfoUV9D6AuHnqemRnbd2L6OesIQHfsfhMyVOgdhuFLFdh4gczyI4C9CfZo7Czx kOvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date; bh=TQA6iP33Qloc6bos5guDYBeN0MCckB8jdqtYo28L/WA=; fh=P2j1Jdod4hu66N1YxlUQSANCzTyVzmdtI81G2F/ZR6s=; b=mMAQV6Q2CzJPpGASRCLFuHZKmDJUBIS4U/QDZsoGIlU3SR61HT39bxp8+4klTzNsBA 2rOyCRMkeVSxyO5bb0s6gzt4SjVsivmOrU9dURjyEiqFnEYd77WvasVA1rCuYqPPS/45 YoYsBkLwEHnhiYaHl20x+ob9A6DUa5Vg/ZcQ7G7+GbjCW815j2gDK/TkXccx1D6+77Tf qkFs+8zYZn8NybY3k5WqAQtNRJqLM+AIpNXVelpkvyIbznXxMgWu3Zn7Xey4rIwG79dl fGi9l8tlBCfVugmeORW2gRkaj2GneYE9xGdtBLEhK2Aqvy+z0SStaqZmn2h2aNh87MRP SpeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-199431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199431-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31b81822si4288484a12.54.2024.06.03.09.32.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 09:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-199431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199431-linux.lists.archive=gmail.com@vger.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 AF76F1F25EE2 for ; Mon, 3 Jun 2024 16:23:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B07F13698D; Mon, 3 Jun 2024 16:22:27 +0000 (UTC) Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23E6319F; Mon, 3 Jun 2024 16:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.133.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717431747; cv=none; b=aD13xsoJr7OkzWsmSudTE4w635YzTnc1C03Qp3Y5W2shmWT6je8iLmHIXhMzoxuzkGxtf22oFpdZgJ2WlluHG7ALOJoEcKMECcnsBeH/05oNNZ0PG4lcQJMffXThW/Bxx/sCOMkmD5EPcoF25NBfo92EG/gQvP/1f3fE/LCAAVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717431747; c=relaxed/simple; bh=8AXwzJpiVoCs+3CzzBhr4vragltIQHKERZT+lejjGro=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=UMXTi7gCX1dIxaAnvUGOvD/DExSLZqSQc7WZ3xzSnkgZMcKlkjA7GBOx71YS6jiPABDza/D8mC0nd/8cxdJGVZlw9kJVrgPgXNrsNCJwfTAdTNQGGpG2uRdlxcWnqy66pkB8g33llqrjWXWad/I8vnyfnDo0VGg9q+MACKv+z7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk; spf=none smtp.mailfrom=orcam.me.uk; arc=none smtp.client-ip=78.133.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=orcam.me.uk Received: by angie.orcam.me.uk (Postfix, from userid 500) id 730D292009C; Mon, 3 Jun 2024 18:22:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 6DFA792009B; Mon, 3 Jun 2024 17:22:22 +0100 (BST) Date: Mon, 3 Jun 2024 17:22:22 +0100 (BST) From: "Maciej W. Rozycki" To: "Paul E. McKenney" cc: John Paul Adrian Glaubitz , Arnd Bergmann , linux-alpha@vger.kernel.org, Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexander Viro , Marc Zyngier , Linus Torvalds , linux-kernel@vger.kernel.org, Michael Cree , Frank Scheiner Subject: Re: [PATCH 00/14] alpha: cleanups for 6.10 In-Reply-To: <7b0a434c-2165-45a0-8507-e7f992094705@paulmck-laptop> Message-ID: References: <20240503081125.67990-1-arnd@kernel.org> <272a909522f2790a30b9a8be73ab7145bf06d486.camel@physik.fu-berlin.de> <5567ab2e-80af-4c5f-bebb-d979e8a34f49@paulmck-laptop> <7b0a434c-2165-45a0-8507-e7f992094705@paulmck-laptop> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) 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 On Fri, 31 May 2024, Paul E. McKenney wrote: > > You're the RCU expert so you know the answer. I don't. If it's OK for > > successive writes to get reordered, or readers to see a stale value, then > > you don't need memory barriers. Otherwise you do. Whether byte accesses > > are available or not does not matter, the CPU *will* do reordering if it's > > allowed to (or more specifically, it won't do anything to prevent it from > > happening, especially in SMP configurations; I can't remember offhand if > > there are cases with UP). Also adjacent byte writes may be merged, but I > > suppose it does not matter, or does it? > > RCU uses whichever wrapper is required. For example, if ordering is > required, it might use smp_store_release() and smp_load_acquire(). > If ordering does not matter, it might use WRITE_ONCE() and READ_ONCE(). > If tearing/fusing/merging does not matter, as in there are not concurrent > accesses, it uses plain C-language loads and stores. Fair enough. > > NB MIPS has similar architectural arrangements (and a bunch of barriers > > defined in the ISA), it's just most implementations are actually strongly > > ordered, so most people can't see the effects of this. With MIPS I know > > for sure there are cases of UP reordering, but they only really matter for > > MMIO use cases and not regular memory. > > Any given architecture is required to provide architecture-specific > implementations of the various functions that meet the requirements of > Linux-kernel memory model. See tools/memory-model for more information. This is a fairly recent addition, thank you for putting it all together. I used to rely solely on Documentation/memory-barriers.txt. Thanks for the reference. Maciej