Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1472130lqp; Fri, 22 Mar 2024 16:52:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYtTXJS/FvNj7JuRqtJlsZHtQ7fCZQ+/s+n6l3JmUcrLPjzwYljDcgZXtO1N5S6+l1JsbLS7QYpNRxEnhkFnvsLIn2ww8AHUxMuZaOBQ== X-Google-Smtp-Source: AGHT+IF/PVXrBjvpOMDbn7VUIqXF/CIlQelwfnJelGkzXKgYpslg1F6e+G7U2CxA6WFszgq+P6bJ X-Received: by 2002:a05:620a:471e:b0:78a:4665:17f2 with SMTP id bs30-20020a05620a471e00b0078a466517f2mr348271qkb.15.1711151561477; Fri, 22 Mar 2024 16:52:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711151561; cv=pass; d=google.com; s=arc-20160816; b=fp+QY1f/tyBPp2LxMOuVASeNnt8CBXl7QJ4die3t4gks9Pq7H9hVEE06XXz5WF5uoN nMgaYloKm6MYORl+ahI3hQfGAYQnV6jELh8oVaHR/d0FPkRB00fZ/qeIZ15TPAPzIbjY txqLJrvShYhT7OpdgL/Jhj4+DSMinBG0FNZqzZDl3FgHerU5TE2G7toa0PeY7O2h5dPc ilCjCbU7L62I1tDtfLOzLlTeM+XCEJho6Yia/B8hLOsRWxwf3D+lXgtzMQTt3dWcpCOQ XZpEl954L4/8rIRmfxQME1W5T9yaWsKGtVAoXseGkIi30VmKEK1GcffFSU+aUvuVDHKx yAAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=cEgMG+B69ydCKnKl83inO8Zb3qtJvyCD019Uz+hkzzs=; fh=hK3SDOsZtbkPyF/a3cn99ifG1SlaS9iUs/Avig4MBoU=; b=TXP6vxzi0mZq/0DfeqmpiClx4JzaKJyktF4e/8/95rBei92ZCPP1WAHABT2PqzkXM3 CCaW9kE1GwHdvi6GA6RfY1n3MUGolORNP1leymsTb/+uXf3tk5Wf/wdMcxnYwsZl8hIp r9JF33yeNOb/u8VsgLBiP2KSBn3il8Dotuv0sDbE67irEZLiGE2RgYaE0+ncFi2zB340 Cs+GwBI2n4JIfwfzE33znsnZTvcTZuMSKcqL6jTygWbRk1UtsuE/mzumfm0DG2MJyZ4p cJlI5m7T0j3Go2iSF/xCgK37OgVnhhtTxiieyCPzOys6tUKWXFqByXIclG8A6l9OKZX4 SZbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Yzb4FpFb; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-112117-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i5-20020a37c205000000b00789ddf7c5d5si669093qkm.38.2024.03.22.16.52.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 16:52:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112117-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Yzb4FpFb; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-112117-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 373E31C21746 for ; Fri, 22 Mar 2024 23:52:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D7EF82D76; Fri, 22 Mar 2024 23:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Yzb4FpFb" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 ABDD88289A; Fri, 22 Mar 2024 23:52:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711151546; cv=none; b=Ks/te+tAwwk0y/4JDYvlJPVkt6wYgvkUt/DrXvORvzYD7EMl7LdTcdQUtHzAAwYZneVUaEFgLYRfWf6L+zH9oHSJJgQGinwxDS8TGoQkfO7nF25Vqft6p/WFsQTDCbogHJqwImll1YRXOpdRSx3d8LXz872t12SmEkViG+jxkZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711151546; c=relaxed/simple; bh=acK5gS17AR6b39Fe+zrX9Reb0a2fMoJXlVkZ7SeAiTM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=h77Ksn7x6VUvTJTKnkBWK8hPBR+Y6t5ACWWmwQLeB++FvFm+Em6v9KpaIpV4NBBf1WrN0RWQzTKOg+hJLSJmVTPGe57Qwn0KgVLkRR2zSIa/+1iCb/zIn2orTbBuwEr70AzUMGrjFbZpQl0ppU8DX1x58HVAbM/yMWXxqd0ITac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=Yzb4FpFb; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=cEgMG+B69ydCKnKl83inO8Zb3qtJvyCD019Uz+hkzzs=; b=Yzb4FpFbbjxyKfNEFDXEBWqApc jlI5wLrK3xiUk8/C5YI2s7752c36lq1M+Acb56T2p7PR9M1XrfmeTL5k+TB18q/rNhtriReYIHqnS AsOZCRMQlTkPsR0D+EzYenA28rGtczCmVVD+Jb4/qF6Vb/66+JYpPE4cooaHq92glorQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rnogC-00AzgP-5Q; Sat, 23 Mar 2024 00:52:08 +0100 Date: Sat, 23 Mar 2024 00:52:08 +0100 From: Andrew Lunn To: Boqun Feng Cc: 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 , =?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 Subject: Re: [WIP 1/3] rust: Introduce atomic module Message-ID: <068a5983-8216-48a5-9eb5-784a42026836@lunn.ch> References: <20240322233838.868874-1-boqun.feng@gmail.com> <20240322233838.868874-2-boqun.feng@gmail.com> 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: <20240322233838.868874-2-boqun.feng@gmail.com> > +//! These primitives should have the same semantics as their C counterparts, for precise definitions > +//! of the semantics, please refer to tools/memory-model. Note that Linux Kernel Memory > +//! (Consistency) Model is the only model for Rust development in kernel right now, please avoid to > +//! use Rust's own atomics. Is it possible to somehow poison rusts own atomics? I would not be too surprised if somebody with good Rust knowledge but new to the kernel tries using Rusts atomics. Either getting the compiler to fail the build, or it throws an Opps on first invocation would be good. Andrew