Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1490901lqp; Fri, 22 Mar 2024 17:50:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFKXCN398iHg2bEPO3thL0clrD+xHRfJgepWbaKfuFGIj6pHv5K5M8+kkg2XgPcXUDrmomP3qJppRoJMT9Bai5LSMgxESmyC/3Gbwyaw== X-Google-Smtp-Source: AGHT+IFMQfQyKjde5RrYbjjoj80MhpGQbSVr8x6ASDxN5BbvsM9l64g3Z+wC1y0swdK1Xxis8Zlx X-Received: by 2002:a17:90a:db58:b0:2a0:3c31:7d07 with SMTP id u24-20020a17090adb5800b002a03c317d07mr1083797pjx.48.1711155005166; Fri, 22 Mar 2024 17:50:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711155005; cv=pass; d=google.com; s=arc-20160816; b=qrih/PPhgJsqM9iZtayQLEkk6cYX5YxXuRodVJWpeirjjQhch5v5z+/l+zXJvdXmyC X5uYpyEUo9D7KwAKl9esw0NBX75gchoMhmrQdWrq3WJLRQxw6ig0i5wYVBV7CTRVvCxR QSHXR3q+/B1g91CheVL0BMN2ctxCI2sBL4MJCdmcgujClGTXEJzLcz/qDbEyDrS4QoQV 7GJWvaIffHqCXKWjhRJHIqhzH45N+eA63Sehdlqm7afiwLb6JVy2GoStzd1dHbClUBku nJkCCtDo8qt1O6dpJ8xaD4k+AzdrEnLRbo4G2E00gblL2BTcpAZmxxYd3l5IHOznAHmw vB3g== 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:feedback-id:dkim-signature; bh=ZJ5iJEyxp0TFbjOIBhDcRyFjdhS9GLo8uwaFuutf5pw=; fh=GVlP1KTEUIVB1LIHWAgoMdiLnYQelNZPIoqSATUoB2Q=; b=0UkslMMELEhsXdi22HNSlhMcKKf59rlq5+WeDC+jaSuNKu1Nup4oHs0xBKqcp5NSTV 8e1Vz16YY8VMpLglCOjpMypDfP5bv9VtjoLMrGNoqEBQnyvPFncl+ywHENnD47g2KSmN dl9zme8DttbRuhaLeoXilUBGPMI1h4wFSi6sg/KqGnZdJiekNNzFffeCO9u5R9i45vfN jpdDlF7ZmrSdPfQ4UTJ6DrQdgyL8cP+b7wIjj/A7wDhc2bbd+Zzp7IzCpK7Vj+BzbTOl tRaUYEB6mIPm/AVM5b/ID1OQfOoSSnod+pdejR1Sk6hSoG6LiBhVY4GKKDOa+YwaQRTu vTrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IvqxBjo6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-112149-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ci19-20020a17090afc9300b002a029fe52b0si3793977pjb.134.2024.03.22.17.50.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 17:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112149-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IvqxBjo6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-112149-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B46322820E8 for ; Sat, 23 Mar 2024 00:50:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F141B2107; Sat, 23 Mar 2024 00:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IvqxBjo6" Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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 9763B621; Sat, 23 Mar 2024 00:49:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711154991; cv=none; b=H5Wp9fNcSrbKJ+Dh6VrNm+UHAGeSHr7BBw19l4wvzdfKYX0/70vzsayrkxKUBieXB0C08lbROMQ19SsT2vjTFREyUlSa7pNnHUd4L2tls0O3d7ypDPAGOYfAsPDN6/7j5rxNoBjIKfB1Z5uJU4SN68O6BOLskPrw4/A0EKztayY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711154991; c=relaxed/simple; bh=UQkYXrBRw3g/7sldWDk09B3+ow7yRo71hjCVT0Y7WMc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mh7AVDzNkFyuuc7U5BkJnsXg5FxICDLEuKwnqslEaU/64LQFEBimNwcqovCOPAFfn31KmmXs8gcCeCKIa5KTNn8vcHJ+CYyZFHStSVQMu5DzbKqBysURAQQTLXsTGGnb8HzNyi9Zu83ev2R0/DC5jkAZCC2t4MJdy2FFc53HnXE= 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=IvqxBjo6; arc=none smtp.client-ip=209.85.128.172 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 Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-611248b4805so11023397b3.0; Fri, 22 Mar 2024 17:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711154988; x=1711759788; 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=ZJ5iJEyxp0TFbjOIBhDcRyFjdhS9GLo8uwaFuutf5pw=; b=IvqxBjo6krSEE7mxdXJmMYMcxI84tZqeE1aHY/Co04IFHF1UG+E2ahn3SQ6ffu/+Gx COctBBGvedXpvuWRa7FHT84t01ZNjtyK1gr2ETKrKggDDjtF1qyln4wx4R8IJhOGcPbQ hwOz3Q7nH3wLozfNfA0d3vSLtdGKbS+zVUhDiYzgV2SR5bLTG427TgziQuJTLUmmFRZF RmCWlrC/V7U7DWvqHB7kKapsqZ2SV6os1U01ih+Ly++ftXh5Ii9YgGIOWJTONjPyk4H9 uIPRYBWHX1aDLtR0bDbFiW3YaTsLjCNjYOfl2CMlMp/LYasAcp8aL+yYBMFLpWmdXFHl Koag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711154988; x=1711759788; 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=ZJ5iJEyxp0TFbjOIBhDcRyFjdhS9GLo8uwaFuutf5pw=; b=uddkhN8p1+Q65e7cTCvMNex1L8/PYz2TEse4Qordj+Ze3w07D4mF58ru5/K+UIOyHo 9qA5CtTzfEkOVhjHUT3TxozCDEA27cAU1zSgRVKL8ialKVd0/XUtwl4+tQ26zotLNV4w 0vA9TrrW0GFmxfnLTJoC/R/1jkudJbXzZhGFBc3d6ijM6/6RSATys8C3/cYFjVSfxG63 Vp6rgtJaFhOgvv4y7gpNmDp3YZ3x4x5cLudIzNvq+NYYArylO9JCgeMkV24ehHbyopyj 7Fr4IZuNzhGSXTSidpmRV/8MGUgZvpKJmBFjks2UJOmai3pREIJrIqzbqW1TNh5tJP6v ZVFg== X-Forwarded-Encrypted: i=1; AJvYcCXXqHy7pt4v9tcFpEhZJdOEbGrTfhUYPr1i2FJjq9Y2gsahBUXIpRYOOHsiPAwyVMNTdlr0AxAD6djwdEYTAkQt9iaEs6XAUY1h66pMR8oAASUSpY+UZwrD+Jh8xzDjjKvTkqkRBx9d8NwctsvyAyF6xgTrszJCsoQx1vXN4qbbURZW4Zlhtbo= X-Gm-Message-State: AOJu0YwAtwzsyNPp9H5CdUZ+IQr581mM1wsSglabs49+PjQCo+O1uBft XxAK/FJONq9pRfCLZip8LVtR3eNFJ6UxrTZ9Giam/CNUf+mnv3XM X-Received: by 2002:a0d:e542:0:b0:609:879a:aef7 with SMTP id o63-20020a0de542000000b00609879aaef7mr1208456ywe.30.1711154988612; Fri, 22 Mar 2024 17:49:48 -0700 (PDT) Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id fa12-20020a05622a4ccc00b00430ad0bda57sm337957qtb.21.2024.03.22.17.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 17:49:48 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfauth.nyi.internal (Postfix) with ESMTP id 136631200066; Fri, 22 Mar 2024 20:49:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 22 Mar 2024 20:49:47 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddtfedgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeehudfgudffffetuedtvdehueevledvhfelleeivedtgeeuhfegueeviedu ffeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 22 Mar 2024 20:49:45 -0400 (EDT) Date: Fri, 22 Mar 2024 17:49:23 -0700 From: Boqun Feng To: Kent Overstreet 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 0/3] Memory model and atomic API in Rust Message-ID: References: <20240322233838.868874-1-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: On Fri, Mar 22, 2024 at 05:15:08PM -0700, Boqun Feng wrote: [...] > > > > I wonder about that. The disadvantage of only supporting LKMM atomics is > > that we'll be incompatible with third party code, and we don't want to > > be rolling all of our own data structures forever. > > > > A possible solution to that is a set of C++ memory model atomics > implemented by LKMM atomics. That should be possible. > Another possible "solution" works in the opposite direction, since the folder rust/kernel/sync/atomic is quite stand-alone, we can export that as a Rust crate (library), and third party code can support using LKMM atomics instead of Rust own atomics ;-) Of course if the project is supposed to work with Linux kernel. Regards, Boqun