From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 BE41814A4E9; Fri, 1 Nov 2024 07:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730444724; cv=none; b=kqMZbt+G6d4TPQeO0YP5vij2IXPwEKwY9WGN91AhP+HvK7MMw7K9jDV1cPlhlG7+lVnSeYYrLLS6XEaRKpuDtFGX1D5UtfOuJbD+iXTcEKysj39j7lPD8Bhgw9rrsHgoq9gSZLaULHrLV9v2peCGtB4ZeZEuN3HdBX64BSqin6Q= 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=nJdWNcHl; arc=none smtp.client-ip=209.85.219.53 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="nJdWNcHl" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6cbcc2bd800so15181616d6.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=lists.linux.dev; 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=nJdWNcHlOpLZi6jaW46oGxkrNbnhDQtGlUY2tZ1jT/IZkqfgkuhPPqp9qj+QyghPL4 4K6laEHOyNcUcJwaF4S37jaRRgyD4bdXe2+jwGyVi/aP49vvbirSPPzJNZ3qEyYKs+yw q3bV4VaR6wrmWnID3v9zwEa56jNzJqVIKbcgd7jdai/BhWdMhFqajEY/zs/Imo7cHQGv OfpHBBR1nXfQ757O22xnpbR6yXWGY7sKJRRasbBtec7KJUZl0MOqrdO19BkT2Tm6JqJc ApfvD0SYH0XhrRbORfTnueETtU/Zlwa6YDrRYIrvy5Vs5hCVBSZXncNjY+KhEVlgM0fK VrZw== 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=EyQL+9hiAv50ZqpzdwMO3rvYYQR5iHcHsKJCE07uVzlZosyR3x9JxUn7w5C9zL9u2c LBhfFkUdxf158ROfV227k0GBW25ODDRoUAR7vOTIZXpTfD8b82iRWN3xF/Lb92d1ve/7 qbr8esjlrAVw76wM9PptDHVbhCuRAzQptkX12omJL7B+hM4S+Fr/3ToKAlfUvS06Pr17 87tnebyBHZSxLr+E7fjGkYOgJhQO/HC8PbWfiIVdLVzh3/QkVoowdBPTAKCNHV1cYaG+ X6OQMtTeUnsxnRM+65cR4/Ou/p60WRojGn736psL/io58LEk8xjOfPQ65CFlhPcETddF N0dg== X-Forwarded-Encrypted: i=1; AJvYcCUQXT54q0XVLA185EM46u26WEjT6qkcD4PiwtwNwQ5mlpFUgV7wZJoZcNu8A3QkxeFGgsZU@lists.linux.dev, AJvYcCXiFK3FW3h6y6m3RdJT4PnYo18Ry6Upyzy3DzP6Aur4sfjXqzeoALYLwEZy2Cso7x8eqrI9Yg==@lists.linux.dev X-Gm-Message-State: AOJu0Yzn03skenw4U4ntXP4TL+ciee/WSuoEj3fjSzN388xmO7MiKyRQ iaa034wa76Z2hENqX0Om1DJBr28E99MovhYoc4MG/ZinK4zp0kk1 X-Google-Smtp-Source: AGHT+IFp7PFcA9Yv18ZEzkJXz4nXgYi4dBXhMW8cGjnyABXDu+HDq6u6pDyh6cUOwHEOB5KNw4VoqA== X-Received: by 2002:a05:6214:5d0d:b0:6cb:e9da:bd4 with SMTP id 6a1803df08f44-6d35424a1b4mr91380006d6.5.1730444721519; 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-6d353f9f1f6sm16124086d6.27.2024.11.01.00.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 00:05:21 -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: lkmm@lists.linux.dev 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