From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B98E1494A7; Fri, 1 Nov 2024 07:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730444724; cv=none; b=jmqfCTieC+aHOOKkb4r+BgxQmJsJc3qL7Fatz6EgjQlmzFOagAF48CTgGhXtrrGFeDURM6yOivYyXuNd682Nz0lyHHjzEGvR5h1BkP76NJSgGoscVIPdVyv5sXMj07Kjz9VY8PxKdh4QT7z1r6c2KNuLCUmvDYsDECMr7sMbOxY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730444724; c=relaxed/simple; bh=ThxAaKztzBi0/cRlZPNliYJwvg/hi15Q8xMYGl3W3fA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nj070xdla1VMfY2rT6xVD72pPZG+n/9u1cLVoRMiDWfWZSNF5vBi96+bluGDWfSwe9MDyLidf8rWuR7ZwdiFMAwITqFi0KawwSb5ES/4KoxdJfA5L9SqRk8LqA0J1LnVCzI+H92ak+3vZnk0Nvoc1tCAiQTi3BSofv7w8IqbN4c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KBVjOAXc; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KBVjOAXc" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6cc2ea27a50so24210786d6.0; Fri, 01 Nov 2024 00:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730444721; x=1731049521; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=CeRtSAMS9mSdK5Z3YnzN1Gk/iNcxNQ7vtANptzs5s5s=; b=KBVjOAXcWCexCu+G2KqhxQzfb2JOdXzNpnggaysw6apOFIGb7wvGFcRYUI7e71Go7y REDznD85wYKUxpZDtinEVHMjjLDoPheLi+dV71tNGf5hyDCjNcbfjH91/2YM1NevGwpX Bz/nX88xoDAYYRN/u0LLq8EvWMG1ScHtkLqeXMNWIpb3FlR9th4OVnNK8/f9C1D1w06x 86SsSucgDi3BjzHCRV63+7zBZz8LU/kOzjYhviMkRfTLp6X1Ud+F1swHhQFluekAftre v9m+qwrlFK+BI/xB3NbZvCPNTrGU+nXy6sJBnjpTUmD9kfms5ofV5GINl3PBxOB7/aPc CWLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730444721; x=1731049521; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CeRtSAMS9mSdK5Z3YnzN1Gk/iNcxNQ7vtANptzs5s5s=; b=AjuERcGMAme3mlskIXqHsn2rBEAo/7QiONToEHupAEUG/nAsdzO0c5KjPpNFNK2jEm Fg8T2Pw13FW4fuW9q4qSgSArA8DgeeIzYrA9bn0tldROoVDZnyfu2TIZSfS8+o1Favd6 OD72/oW00tu7fwxKgO+w5XQcQt88w+wjk/JFyV68yiihmnwq7tC6t+y0liBGSvK5hcVZ UC4LPukjCeLOybAmhzkAGNlKGpkyu4ypL8cxWhVpna0jxq4bJdpE0BaltQ0onmVpWp45 gbFyDoVzLOLKsyOSsSJD5n9GacLHHlW6qRicw//+YB524WQ0kE0K9b8fGGP+EX18CXQ0 nCyw== X-Forwarded-Encrypted: i=1; AJvYcCVaAOC21FyDtN3YIOWYh/ByLFOPYGowcQ4UKs5Mqv78he1ke4Wm1YrdZifbudJpoE2Z73AL7vF/aaVM7V03ZQ==@vger.kernel.org, AJvYcCViM6D1W8GJzBJm2GHaDzk7c8dFDYaiv9E46N7j2KSdl5chWsvGat6ekFUiVfQPsd9DLT3E@vger.kernel.org, AJvYcCWPrPQDfQPUl63g8YGmsZmiuGPcNPYxvhTh/xraf8Sh3X8+zRnjNRaoRWIadUyVJxgBh0OJgjviHH8AIHzK@vger.kernel.org, AJvYcCXcrs70+fXUU0EubW3zmBKBZYSkoAdRmStISrHg318O8HuqhrZsUET88GmCQf5HHYjcNJeqAZpMvvKi@vger.kernel.org X-Gm-Message-State: AOJu0YyGhEQX0En9zMT8UnvmSte8c0Vd0ZXrpQxoH0aEUyHO+qDpg+6w 6SRoOZGuboNT8x64U2dNWQprH7/QLk0gxqLBDO2cHM3sB+Uv8BoGlBeiVoFI X-Google-Smtp-Source: AGHT+IFrsBo99R77+QegcYKVQJQa7o75kxQSDycQVpMwSj1BelPv4m5AvmbCAqFWjQIDvFEi2jWTGQ== X-Received: by 2002:a0c:c682:0:b0:6d1:6fae:6451 with SMTP id 6a1803df08f44-6d3542aa362mr74394476d6.10.1730444721125; Fri, 01 Nov 2024 00:05:21 -0700 (PDT) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d353f9f4e4sm16288896d6.10.2024.11.01.00.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 00:05:20 -0700 (PDT) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id 4AB8A1200043; Fri, 1 Nov 2024 03:05:20 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Fri, 01 Nov 2024 03:05:20 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdekkedguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddv necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhephedugfduffffteeutddvheeuveelvdfhleel ieevtdeguefhgeeuveeiudffiedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeehkedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtohepuggrvhhiughgohifsehgohhoghhlvgdrtg homhdprhgtphhtthhopehruhhsthdqfhhorhdqlhhinhhugiesvhhgvghrrdhkvghrnhgv lhdrohhrghdprhgtphhtthhopehrtghusehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtg hpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhr tghpthhtoheplhhinhhugidqrghrtghhsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtg hpthhtoheplhhlvhhmsehlihhsthhsrdhlihhnuhigrdguvghvpdhrtghpthhtoheplhhk mhhmsehlihhsthhsrdhlihhnuhigrdguvghvpdhrtghpthhtohepohhjvggurgeskhgvrh hnvghlrdhorhhgpdhrtghpthhtoheprghlvgigrdhgrgihnhhorhesghhmrghilhdrtgho mh X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Nov 2024 03:05:19 -0400 (EDT) Date: Fri, 1 Nov 2024 00:04:09 -0700 From: Boqun Feng To: David Gow Cc: rust-for-linux@vger.kernel.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, llvm@lists.linux.dev, lkmm@lists.linux.dev, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Joel Fernandes , Nathan Chancellor , Nick Desaulniers , kent.overstreet@gmail.com, Greg Kroah-Hartman , elver@google.com, Mark Rutland , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , torvalds@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, Trevor Gross , dakr@redhat.com, Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Subject: Re: [RFC v2 11/13] rust: sync: Add memory barriers Message-ID: References: <20241101060237.1185533-1-boqun.feng@gmail.com> <20241101060237.1185533-12-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: rust-for-linux@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: On Fri, Nov 01, 2024 at 02:55:23PM +0800, David Gow wrote: > On Fri, 1 Nov 2024 at 14:07, Boqun Feng wrote: > > > > Memory barriers are building blocks for concurrent code, hence provide > > a minimal set of them. > > > > The compiler barrier, barrier(), is implemented in inline asm instead of > > using core::sync::atomic::compiler_fence() because memory models are > > different: kernel's atomics are implemented in inline asm therefore the > > compiler barrier should be implemented in inline asm as well. > > > > Signed-off-by: Boqun Feng > > --- > > rust/helpers/helpers.c | 1 + > > rust/kernel/sync.rs | 1 + > > rust/kernel/sync/barrier.rs | 67 +++++++++++++++++++++++++++++++++++++ > > 3 files changed, 69 insertions(+) > > create mode 100644 rust/kernel/sync/barrier.rs > > > > diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c > > index ab5a3f1be241..f4a94833b29d 100644 > > --- a/rust/helpers/helpers.c > > +++ b/rust/helpers/helpers.c > > @@ -8,6 +8,7 @@ > > */ > > > > #include "atomic.c" > > +#include "barrier.c" > > It looks like "barrier.c" is missing, so this isn't compiling for me. > I assume it was meant to be added in this patch...? > Yes, I just send an updated one. Glad being "checking missing files" buddies with you ;-) Thanks! Regards, Boqun > Thanks, > -- David