Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1077779lqs; Fri, 14 Jun 2024 14:23:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhabtpbn5SY8xwQRz4rc8pyCMHtC9BlZgO5GsO//v8P+6ISQxpGzax0PcM84+N20uI+ChIbZN9apMZf2+0twanOcLxpm0L74R2ely6jA== X-Google-Smtp-Source: AGHT+IF/+rhn8/AMUPm6FkGxiOCFJSLuXdqtDJgQORtwmk02d9JIcDLA2CCXpoDrKbs4Fsi8lVz/ X-Received: by 2002:a17:902:e543:b0:1f7:1a9:bf09 with SMTP id d9443c01a7336-1f862a169bcmr46229795ad.51.1718400230041; Fri, 14 Jun 2024 14:23:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718400230; cv=pass; d=google.com; s=arc-20160816; b=QpL+aQsbD2uHDnUYJVoavwqEKHqb785iUpSy0ScZwckMJuQVOtN5I4Hvab+pafbCCJ KDpZY7OpPzfchLxWE02QHXY3oV0cSQCB9I6adk59heviQ8+zArYD4EG+lY/neFA/vCvI ssyTrM8KIuHOVyjKxPPwbKzpyn+SeJhQvaRsA6LKeOPpH+YlDgep8FlukhhgpUkLCeP0 ecAiTobTg1bxp4uQlqZKa7z2ZxA+K4K3ntU9CgK80Q6B3wvkNFxVg0Ov4EG8kPEjMbZx zZXCDrxQY/wkIwUIhYB/8aUbhi9SUt2WixVzDPqBSbxA7Pe1JedoOHj80ejgKO/AaeHl 7f2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=mI0xdPiIrvwp6EccuD83bzOdj0amVBKo2auwQXYt8uE=; fh=6dgnth+gcHSmRSXKsIf+TFNoMQ+dUDiz7KBdMRSUIEI=; b=DNX4Bj/g6EPH6xR8uRmkw6S7iNWCC3Eo5GCKdI5tafLPOtk0+QbvKojDJF2+q8sBNw aDW3siap5V0xbT/OX4Czjo9DUrVrVnvxc7hee0YOuYGvQe8AdsrPLjIjhsatWJkvbXVn 9+rFj/Dsuisd8bveqU7KeUIbXVz7tncMN6NRCbzSrWcaEnj54u6Y398GHP0BUbwRh+U3 ILp5++Z8E7T8JXKoyg1yyGVIHuKCLMfQbmzQJm9+bMRmVWPG+vSPsLdLb4SVz9SvmpUB LNFTYBD9/bFSmIBBlPUj2UxLaPPqP6BuF72NtFgcEusQ8kTzKWffw62EunpaHG9iDjyI kQ0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=masz3u7cozgmbioxpjqwm7i5ae.protonmail header.b=GGbMHccH; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-215496-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215496-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f855efb4c7si24998605ad.453.2024.06.14.14.23.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 14:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215496-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=@proton.me header.s=masz3u7cozgmbioxpjqwm7i5ae.protonmail header.b=GGbMHccH; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-215496-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215496-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me 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 94C5B28854B for ; Fri, 14 Jun 2024 21:22:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 251D5184128; Fri, 14 Jun 2024 21:22:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="GGbMHccH" Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) (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 5843F13A24B; Fri, 14 Jun 2024 21:22:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718400163; cv=none; b=WZx+ewLtxT3GZETcRxljiCmxmcPc0mdZfjUOh4XUWyqfYcBt8OQJuEd9CrEudT1q4n4P0dhVE/AZNwD+NZLORFI9u/jrPyV2Lrr+J25PStiig36edQ+V3uY0mpzYxQZA+sFIF3V87/tiXRZAUA8TgwgWusag6rqeP8Xx5MVi0dE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718400163; c=relaxed/simple; bh=mI0xdPiIrvwp6EccuD83bzOdj0amVBKo2auwQXYt8uE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Q61tnWaCXIGZQYHYEHlOtSsjB8DrW02zqtDGn9zT2s9hfk8d6jo29gcFiSpwED268xntkWbRo3S43EEGyMQ60/VldFzFngj4ni4WdWk+Om8y4LsJUYDd95ptW3OlTtOVPiQCrWzDEC1W7cpdxyQXee8/QDczuJfAlrCzCLo+nwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=GGbMHccH; arc=none smtp.client-ip=185.70.40.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=masz3u7cozgmbioxpjqwm7i5ae.protonmail; t=1718400152; x=1718659352; bh=mI0xdPiIrvwp6EccuD83bzOdj0amVBKo2auwQXYt8uE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=GGbMHccHMMsGnA/ccfGbUrR5Ou/GaweRk7E0oAtlGGyBcg52NBBjlrI00Y/agaBDJ CEufLLgMBzlcAvbGboVOpXkQluxsmGSAzGhdhYEtoFmexZg5DmttSiVAvUGT51qbBe V33dUaziIsAWC4qndI9dLduaBwSF+BZdcDikAIXaIm1bjM3RIJ/ARE05k6WRxH38GZ K+dNjGtj7D7LksWZAk+iuEDyO+dWA7bDW9f44Eqxpwld1dTVHkP0nHv0L3ES4lwzdS 7/dA6hIHPXoLvQ25Yht47pYU0Cav3JsEJrb3po6zYvO07E+iCD1RN5VagbqatQnhMM mb3QBQhupzr1A== Date: Fri, 14 Jun 2024 21:22:24 +0000 To: Boqun Feng , Miguel Ojeda From: Benno Lossin 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?= , 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 Subject: Re: [RFC 2/2] rust: sync: Add atomic support Message-ID: In-Reply-To: References: <20240612223025.1158537-1-boqun.feng@gmail.com> <20240612223025.1158537-3-boqun.feng@gmail.com> <20240613144432.77711a3a@eugeo> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: 53ca9493f4ed178b60e9c57bdabd3b5e208fb377 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=utf-8 Content-Transfer-Encoding: quoted-printable On 14.06.24 16:33, Boqun Feng wrote: > On Fri, Jun 14, 2024 at 11:59:58AM +0200, Miguel Ojeda wrote: >> On Thu, Jun 13, 2024 at 9:05=E2=80=AFPM Boqun Feng wrote: >>> >>> 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, >=20 > The truth is I don't know ;-) I don't have much data on which one is > better. Personally, I think AtomicI32 and AtomicI64 make the users have > to think about size, alignment, etc, and I think that's important for > atomic users and people who review their code, because before one uses > atomics, one should ask themselves: why don't I use a lock? Atomics > provide the ablities to do low level stuffs and when doing low level > stuffs, you want to be more explicit than ergonomic. How would this be different with `Atomic` and `Atomic`? Just because the underlying `Atomic` type is generic shouldn't change this, right? --- Cheers, Benno