[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DCCN4NA8LSGD.10TKRH3LRGAEN@kernel.org>
Date: Tue, 26 Aug 2025 22:27:00 +0200
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Daniel Almeida" <daniel.almeida@...labora.com>
Cc: <akpm@...ux-foundation.org>, <ojeda@...nel.org>,
<alex.gaynor@...il.com>, <boqun.feng@...il.com>, <gary@...yguo.net>,
<bjorn3_gh@...tonmail.com>, <lossin@...nel.org>, <a.hindborg@...nel.org>,
<aliceryhl@...gle.com>, <tmgross@...ch.edu>, <abdiel.janulgue@...il.com>,
<acourbot@...dia.com>, <jgg@...pe.ca>, <lyude@...hat.com>,
<robin.murphy@....com>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 3/5] rust: scatterlist: Add abstraction for sg_table
On Tue Aug 26, 2025 at 10:16 PM CEST, Daniel Almeida wrote:
> // SAFETY: It is not possible to mutate a `SGEntry` through a shared reference,
> // so it is safe to send a &SGEntry to another task.
>
> Or any variation of the wording above.
>
> In any case, I agree that this is splitting hairs a bit and I have nothing
> against keeping it as-is, I just thought it be a tad clearer :)
Yeah, that's what I meant. The definition of Sync even says "Types that are not
Sync are those that have interior mutability in a non-thread-safe form [...]".
[1].
So, both our wordings basically come down to "It's Sync because it's Sync." :)
But don't get me wrong, I'm fine being a bit more verbose about this.
[1] https://doc.rust-lang.org/std/marker/trait.Sync.html
Powered by blists - more mailing lists