Rust for Linux List
 help / color / mirror / Atom feed
From: Philipp Stanner <phasta@mailbox.org>
To: "Andreas Hindborg" <a.hindborg@kernel.org>,
	"Philipp Stanner" <phasta@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Lyude Paul" <lyude@redhat.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Frederic Weisbecker" <frederic@kernel.org>,
	"Neeraj Upadhyay" <neeraj.upadhyay@kernel.org>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Josh Triplett" <josh@joshtriplett.org>,
	"Uladzislau Rezki" <urezki@gmail.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	"Lai Jiangshan" <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang@linux.dev>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Yury Norov (NVIDIA)" <yury.norov@gmail.com>,
	"Asahi Lina" <lina+kernel@asahilina.net>,
	"Lorenzo Stoakes" <ljs@kernel.org>,
	"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
	"Eliot Courtney" <ecourtney@nvidia.com>,
	"Mirko Adzic" <adzicmirko97@gmail.com>,
	"Daniel del Castillo" <delcastillodelarosadaniel@gmail.com>,
	"Alistair Francis" <alistair.francis@wdc.com>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	 linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	 linaro-mm-sig@lists.linaro.org, rcu@vger.kernel.org
Subject: Re: [PATCH v6 4/6] rust: xarray: Add support for index reservations
Date: Wed, 05 Aug 2026 10:53:19 +0200	[thread overview]
Message-ID: <fb668789376a8a2289cbfe4ef64d9e1bdeb5ff39.camel@mailbox.org> (raw)
In-Reply-To: <87se4t7xy7.fsf@t14s.mail-host-address-is-not-set>

On Wed, 2026-08-05 at 10:50 +0200, Andreas Hindborg wrote:
> "Philipp Stanner" <phasta@kernel.org> writes:
> 
> > One often cannot allocate in the kernel with the desired flags, most
> > notably in atomic context. Pre-allocating the memory is the preferred
> > solution in such situations.
> > 
> > Add support for xa_reserve() in the Rust abstractions of xarray. Create
> > a Reservation object similar to a lock-guard, that can be dropped once
> > the reservation is no longer needed or once the index was stored to.
> > 
> > Signed-off-by: Philipp Stanner <phasta@kernel.org>
> > ---
> > Please regard this more as an RFC.
> > 
> > I need pre-allocating in XArray for DmaFence. How exactly we achieve
> > this is open for discussion.
> 
> Do you need to actually reserve a key, or do you just need atomic
> allocation?

I would just have needed a position to store to, but the fence sequence
number would be the only reasonable index, so you'd also reserve a key.



Anyways, please forget about this for now, we abstained from using the
XArray in the current revision (v8) of this patch series.


Thx
P.

  reply	other threads:[~2026-08-05  8:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 14:49 [PATCH v6 0/6] rust / dma_buf: Add abstractions for dma_fence Philipp Stanner
2026-07-22 14:49 ` [PATCH v6 1/6] rust: types: implement ForeignOwnable for ARef<T> Philipp Stanner
2026-07-22 14:49 ` [PATCH v6 2/6] rust: error: Add ECANCELED error code Philipp Stanner
2026-07-22 17:44   ` Alistair Francis
2026-07-22 18:38   ` Timur Tabi
2026-07-23 11:56     ` Philipp Stanner
2026-07-23 12:06       ` Miguel Ojeda
2026-07-22 14:49 ` [PATCH v6 3/6] rust: sync: Add abstraction for rcu_barrier() Philipp Stanner
2026-07-22 14:49 ` [PATCH v6 4/6] rust: xarray: Add support for index reservations Philipp Stanner
2026-08-05  8:50   ` Andreas Hindborg
2026-08-05  8:53     ` Philipp Stanner [this message]
2026-07-22 14:49 ` [PATCH v6 5/6] rust: Add dma_fence abstractions Philipp Stanner
2026-07-22 14:49 ` [PATCH v6 6/6] MAINTAINERS: Add entry for Rust dma-buf Philipp Stanner

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=fb668789376a8a2289cbfe4ef64d9e1bdeb5ff39.camel@mailbox.org \
    --to=phasta@mailbox.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=adzicmirko97@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=alistair.francis@wdc.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=christian.koenig@amd.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=delcastillodelarosadaniel@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ecourtney@nvidia.com \
    --cc=frederic@kernel.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joelagnelf@nvidia.com \
    --cc=josh@joshtriplett.org \
    --cc=lina+kernel@asahilina.net \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=lossin@kernel.org \
    --cc=lyude@redhat.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=phasta@kernel.org \
    --cc=qiang.zhang@linux.dev \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=urezki@gmail.com \
    --cc=work@onurozkan.dev \
    --cc=yury.norov@gmail.com \
    /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