rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tamir Duberstein <tamird@gmail.com>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Maíra Canal" <mcanal@igalia.com>,
	"Asahi Lina" <lina@asahilina.net>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 2/2] rust: xarray: Add an abstraction for XArray
Date: Tue, 19 Nov 2024 11:39:57 -0500	[thread overview]
Message-ID: <CAJ-ks9k4upcSfa2HXaMrtDJ37eTNc-ZiKZdcLuEYSnWHL5Bigw@mail.gmail.com> (raw)
In-Reply-To: <CAH5fLggL7MTLVv2ym_tCCKH9hQtL=GpTwXjDUQzKQX9UdT7SkA@mail.gmail.com>

On Tue, Nov 19, 2024 at 11:28 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> On Tue, Nov 19, 2024 at 5:24 PM Tamir Duberstein <tamird@gmail.com> wrote:
> >
> > On Mon, Nov 18, 2024 at 5:18 PM Boqun Feng <boqun.feng@gmail.com> wrote:
> > >
> > > On Mon, Nov 18, 2024 at 11:33:36AM -0500, Tamir Duberstein wrote:
> > > [...]
> > > > +
> > > > +/// A lock guard.
> > > > +///
> > > > +/// The lock is unlocked when the guard goes out of scope.
> > > > +#[must_use = "the lock unlocks immediately when the guard is unused"]
> > > > +pub struct Guard<'a, T: ForeignOwnable> {
> > > > +    xa: &'a XArray<T>,
> > > > +}
> > >
> > > `Guard` would be `Send` if `XArray<T>` is `Sync`, however, it's
> > > incorrect since `Guard` represents an xa_lock() held, and that's a
> > > spin_lock, so cannot be dropped on another thread/context. `Guard`
> > > should probably be marked as `!Send`. Or am I missing something subtle
> > > here?
> >
> > I didn't know about this requirement, thanks for calling it out. I
> > have added `_not_send: PhantomData<*mut ()>` in v10.
>
> You can use _nts: NotThreadSafe. The type in question has landed in
> 6.13 and is available in Linus's tree since yesterday.

TIL, thanks - though it looks like the field name is still `_not_send`.

How do I set the base-commit/deps such that both
https://github.com/torvalds/linux/commit/e7572e5deaf3bc36818f19ba35ac8e0c454c8bac
and https://github.com/Rust-for-Linux/linux/commit/d072acda4862f095ec9056979b654cc06a22cc68
are present, given that the former is in 6.13 and the latter in
rust-next?

  reply	other threads:[~2024-11-19 16:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 16:33 [PATCH v9 0/2] rust: xarray: Add a minimal abstraction for XArray Tamir Duberstein
2024-11-18 16:33 ` [PATCH v9 1/2] rust: types: add `ForeignOwnable::PointedTo` Tamir Duberstein
2024-11-18 16:33 ` [PATCH v9 2/2] rust: xarray: Add an abstraction for XArray Tamir Duberstein
2024-11-18 22:18   ` Boqun Feng
2024-11-19 16:23     ` Tamir Duberstein
2024-11-19 16:28       ` Alice Ryhl
2024-11-19 16:39         ` Tamir Duberstein [this message]
2024-11-19 16:43           ` Alice Ryhl
2024-11-19 16:51             ` Tamir Duberstein
2024-11-19 16:52               ` Miguel Ojeda
2024-11-19 18:22                 ` Tamir Duberstein
2024-11-19 18:40                   ` Miguel Ojeda
2024-11-19 18:55                     ` Tamir Duberstein
2024-11-18 16:51 ` [PATCH v9 0/2] rust: xarray: Add a minimal " Miguel Ojeda
2024-11-18 17:02   ` Tamir Duberstein
2024-11-18 17:05     ` Miguel Ojeda
2024-11-19 11:11     ` Maíra Canal
2024-11-19 12:26       ` Asahi Lina
2024-11-19 14:21         ` Tamir Duberstein
2024-11-19 14:24           ` Tamir Duberstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ-ks9k4upcSfa2HXaMrtDJ37eTNc-ZiKZdcLuEYSnWHL5Bigw@mail.gmail.com \
    --to=tamird@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=lina@asahilina.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcanal@igalia.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).