From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EEE1C67861 for ; Tue, 9 Apr 2024 10:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QC5Z9/yfwJzn64PO8Slbm+yCOF9QS+B6geYMa05dVNM=; b=WE9J5vYL1ZeqfH 6T7wt+PWUteMDIzyw0Au8zIFy9Faf51WvfIPVicUn1yVtZf/8lYf0zoefBQhNX8G1GgFGrV+MmOaw uwfnioWDFBCSNWeZ+23dmqPMvUPVKKdQrGc73I6EslqmCYkM2xmuNu+gU0zvfY5nCLChFAwhLmAZq u5ft4JVyOdLv5CROZlVgqL8xkq4OVimN1bHT2G2lMqq87DBkoPZ+20ZxP3k847rXWqFiP+EEe4z2j ihVefcWNpvKWCFHLALJozY+854FDTM4XopOkTw2zjIjf2Lmzs2JKSpgNp3fsJSauxqxYHVcgo7Tro NlQ2H2ylURpJgcaK/Igw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru93i-00000001Wes-2wPr; Tue, 09 Apr 2024 10:50:34 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru93g-00000001Wdz-2bGv for linux-arm-kernel@bombadil.infradead.org; Tue, 09 Apr 2024 10:50:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fdPl3WFCWHLRN70qmtNx/X3LaV4RnMmwDJdJ+T0QErQ=; b=A6+c2l4NtzCr3n9/z3r782zwiM t8LFZ2Y+6asvkVk0ieqbUPKWxtF67/X0IAKbJiidA9qgUMCQu80Bd3Ys70P+z1te0VntRDE6sSgSY od9Q4gM6yCXEsrnDuoAvwP49i2cA1aJ4AV5t5dJJJ9TI4oHZ6vjCMcMcrqZTcf8Xm5TXOwyzEkmJD aeVg+rKtRVKRuL2YMkIfLqGYTnjFPe+NQBKSioszfByY63QFkGFeO0C4uaypuWZ4L2Qd1pDGR4ooc xgsclxyA2Ldrsb2q7geUJ5Qs31a4NVyzYmJc97Jplwk1LT2VPVVjQylOoLtgQk5zMsBgGEgMjtG9B zNw4txXA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru93Q-00000007Z81-2AVo; Tue, 09 Apr 2024 10:50:17 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 0C0F630040C; Tue, 9 Apr 2024 12:50:16 +0200 (CEST) Date: Tue, 9 Apr 2024 12:50:15 +0200 From: Peter Zijlstra To: Boqun Feng Cc: Mark Rutland , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, llvm@lists.linux.dev, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , "Bj\"orn Roy Baron" , Benno Lossin , Andreas Hindborg , Alice Ryhl , Alan Stern , Andrea Parri , Will Deacon , 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, 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 Subject: Re: [WIP 0/3] Memory model and atomic API in Rust Message-ID: <20240409105015.GC21779@noisy.programming.kicks-ass.net> References: <20240322233838.868874-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 25, 2024 at 01:59:55PM -0700, Boqun Feng wrote: > On Mon, Mar 25, 2024 at 10:44:45AM +0000, Mark Rutland wrote: > [...] > > > > > > * I choose to re-implement atomics in Rust `asm` because we are still > > > figuring out how we can make it easy and maintainable for Rust to call > > > a C function _inlinely_ (Gary makes some progress [2]). Otherwise, > > > atomic primitives would be function calls, and that can be performance > > > bottleneck in a few cases. > > > > I don't think we want to maintain two copies of each architecture's atomics. > > This gets painful very quickly (e.g. as arm64's atomics get patched between > > LL/SC and LSE forms). > > > > No argument here ;-) Didn't we talk about bindgen being able to convert inline C functions into equivalent inline Rust functions? ISTR that getting stuck on Rust not having a useful inline asm. But fixing all that in a hurry seems like the much saner path forward. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel