From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-40131.protonmail.ch (mail-40131.protonmail.ch [185.70.40.131]) (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 954CD13A24B for ; Fri, 14 Jun 2024 21:22:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718400158; cv=none; b=TuS1ZWAbiIaftZ2XSJU+dew4p6c1NrDSiTtH2Qoy/TJZa7WOjkrw4z7pVSHHtViaDxymA1cVK025xQn2+4fKDqT1IyaZhLcVFs1Zj9VMrv6BlekZ3i8vpsYRGNOr2Z+yqbMHC9jOB65WXdUg+cZ4/2XOePWPbutB8D6+w5yS2e0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718400158; c=relaxed/simple; bh=mI0xdPiIrvwp6EccuD83bzOdj0amVBKo2auwQXYt8uE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ehm8tP55pdAFEm6QFchozq3OitXlv78VPv4kF4wSVFt4EDR6wi8CdJjHjd+r669hHOaonaefN2usXggQriKhHHzSAUxhSEN00HxfL+B9ykbgIBvr01iDuB241x0HzHN6tZN1ilaB96H0rTgZw1EpqjUhW4Pgd5ZJKNT55oyHjSo= 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.131 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="GGbMHccH" 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-fsdevel@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