Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp702671lqs; Fri, 14 Jun 2024 03:15:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXW00cbRDsf/U4aoW6RNtmFV7BTpJ/CaCZ9vUCidjNAn7ZMuQnIzQ43LnWg77/7k37YWgDkVQuUReHHh5gEQzKMkGnAt7W24LitTLOLYg== X-Google-Smtp-Source: AGHT+IFno38bfY/lSHlYYkWDwm2l10OWWRn67ZJT7yqBTEa4Kk386hVidoORJHaG5xbC0NBJYKPY X-Received: by 2002:aa7:da54:0:b0:57c:c0d6:c95f with SMTP id 4fb4d7f45d1cf-57cc0d7057bmr1050254a12.35.1718360136206; Fri, 14 Jun 2024 03:15:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718360136; cv=pass; d=google.com; s=arc-20160816; b=jS5iMC2IRayh8qbi5Oy92VsLMvsAj9yxsRJRa6THhUSdf5wFpIweMs3ybnKLQfi3A0 iUQf2edHnCPiDRCiYg3NeYU7rEDwqJRh84X7GwuKw5cy9mACk14gUxP9ccxhQDwkfHQT j54kAY8rvVieq46i9g37mP0rpjxeCG1EYOwbLDzQx28IBnTKwhhNwNy6oSOwkL1EUy7/ ATqK9xqp/p98nlB8QhjmL5/P+l0gwZkcthUnd2fH+jr+62GDTM4LlM5kIvQ0GbHo5/G0 X0cXlUfc0+HPfN7RUI+CFTi2dW4dzqfaIORMHfA1xo6h7HwXoB1roizR8RiDmZzwcczl /IYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=CBAdIAt33/2nqpZ8vIydnCg5rpba2GT3bMlI628Yd0U=; fh=S3BI13LSxD1hsbT/HL5eaczskqXTshwP96JVegR1Dwk=; b=vYrasTwkvRN0ZbMQI9aiToHxxrGVGoJEL91dffAd9C3McqcKEMQLzxRG03smW5sYXF LBfl7k8Kk33XOhLyGOwciOx+Eif7Xhc+vh7986cySdfH/bQlGKS4MY8xxt8yCxD5Ivhn fIZjI2mJzhBjxFiy3rukhr4a9iw35gop2HpSE6FmDJ1IINMebwqhhQasnJrLKxG3SJxH eQ+RaiZnG+siollZP/Dqj9Mr39F6JRAuFJQIqQmz5xwi10InuBdesb/JFKUl0ZrnjkVH 5jdIESxCFlSZKzGqCH/l8e7pokbICHgPulxpYwdQ33h9s5LX+qVVhObZ982+UNAIMOhL nsfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=A1NDvVVb; 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-214725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214725-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb74790b8si1598027a12.664.2024.06.14.03.15.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 03:15:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=A1NDvVVb; 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-214725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214725-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 460191F2AA2A for ; Fri, 14 Jun 2024 10:06:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB771194A59; Fri, 14 Jun 2024 10:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A1NDvVVb" Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 915421922C1; Fri, 14 Jun 2024 10:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718359213; cv=none; b=cZ+yqrIlnXr1LJKpV8BASP2PGl/jwgYlgRaHTs0qeBnVY4hsPqSN5QGFzqOuqAaeGBt6TGVYGmaRxLn2oit1ZGTGsWjCIDsQio6vbLQRCY/e+xV3Cle+41W54ux6qasizPIpy/NhjT1dyp769EXjXo65TO9xAJfDZ1sF95K+mns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718359213; c=relaxed/simple; bh=CBAdIAt33/2nqpZ8vIydnCg5rpba2GT3bMlI628Yd0U=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eMIXotHGamaub2vS3otYATeksw0w4sOUxPQ77ZxqJKB0c/YUobOEGpMZjzsKgnxDNjHIBIscE7xc36fFo8vVOxXMyUCx6SXkq5biHywGoEiLwVNoURlKal07iN3o+Vn4Aez06XUiNc7jwZND/Q3sNKH8zWt4CeN9HZuEy435XYE= 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=A1NDvVVb; arc=none smtp.client-ip=209.85.216.42 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-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2c2d25b5432so1585457a91.2; Fri, 14 Jun 2024 03:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718359212; x=1718964012; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CBAdIAt33/2nqpZ8vIydnCg5rpba2GT3bMlI628Yd0U=; b=A1NDvVVbY6oMwaoScrvnM3MGnNBW9TVmvzNSrBMGgj+qpwqmfDrOPBZa7/KBvdLQ2S WpcBo0Xi9RwX7KjhckidjeTz3jtUKRcDDtlDeQvCN6UTryj5VNwRaauMbm/9yiiov2j9 XliRBsMVEFbH9Hu4rikLsxSiiNx0QoZeycNXWljDIAOoGZTCGXNPIoQJbGD2XyIbABck shrsl/asSYj93VRCpE7BXwEIke7ym2GSAaI1NGdinK31lrCTsBj8zvRbCdy+GCBTzS7W b1Ssw1tiRwM9ASmNusJGscScfKnP2ONwZX9J0+0he/bwfbEirqO7fPBSqQ66IBOBLoUw 39+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718359212; x=1718964012; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CBAdIAt33/2nqpZ8vIydnCg5rpba2GT3bMlI628Yd0U=; b=A+R9LigVLNB2oZI2Ne7f4ZzSXJGR8BWfne/XwZAif+7pbHGdmYgJc7PhhQmTeKbDF/ l3aVjKK8DUVUITXTrdBDZyZrmZ23eirHzV/byuw7r7KDJZSt5Xue0lneZKtBbVu7yxGy pGrjqEaxGOClBTGfp4exfucDM6WV4PuK8mYcW9iV1f5BHbHlDBEk0ugrlMXhYu+/6g1Z 53WrCXdINx9uTDrCHkSZ23GhG8qFGVKC7oYyRl6AzcZfx2GeL/YHS6nTWyB25qrH0Y4E KaNPo65Wt+BaeldHMLSkifubqWwcaF+R9Yx9S+eNTYaq/yTpCwzFjOmXTLcAXiFkAOpj 2FPg== X-Forwarded-Encrypted: i=1; AJvYcCXC7iHel95lQChOmvBo545nVyyU2xsFShvQol7V9rvAUbBNTxN8ukeIb80R38c38862Y0L+0oyFHVBOgDPXVMmmhgkyoFk4EbmEwyaWOgMEEVW4W2liVoAnSLWMC1jJlWnROYR50g6oA0TrLu42IHtI2yUW5Zzmk+bKCh2K0QdHeoB6crbylEmlDiOSsxMfbevx+R3o+LJriynhJnRfR9/XJyRHtnb2dQ== X-Gm-Message-State: AOJu0YzzMeXYKwIhVcfxnl6RCx7Znm8J3qojkRUUGDKN5DSoVGAFHd6D XMoKJwGuHaT/Ibv3xuFlXpEbTK5qzdKa3Wj2fpVxoleHDobzSwoJQSzE4OkPBeJi/mZ32bCzzMZ ZiBy5lEMmCcHD7CUBdDEdsuEwD1s= X-Received: by 2002:a17:90a:d383:b0:2c2:f2f9:a121 with SMTP id 98e67ed59e1d1-2c4db8589c0mr2098796a91.39.1718359210973; Fri, 14 Jun 2024 03:00:10 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240612223025.1158537-1-boqun.feng@gmail.com> <20240612223025.1158537-3-boqun.feng@gmail.com> <20240613144432.77711a3a@eugeo> In-Reply-To: From: Miguel Ojeda Date: Fri, 14 Jun 2024 11:59:58 +0200 Message-ID: Subject: Re: [RFC 2/2] rust: sync: Add atomic support To: Boqun Feng Cc: Gary Guo , 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 , =?UTF-8?Q?Bj=C3=B6rn_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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 13, 2024 at 9:05=E2=80=AFPM Boqun Feng w= rote: > > Does this make sense? Implementation-wise, if you think it is simpler or more clear/elegant to have the extra lower level layer, then that sounds fine. However, I was mainly talking about what we would eventually expose to users, i.e. do we want to provide `Atomic` to begin with? If yes, then we could make the lower layer private already. We can defer that extra layer/work if needed even if we go for `Atomic`, but it would be nice to understand if we have consensus for an eventual user-facing API, or if someone has any other opinion or concerns on one vs. the other. Cheers, Miguel