[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DC8VTZ5OZY42.1OCS3QJHZGPAK@kernel.org>
Date: Fri, 22 Aug 2025 12:25:34 +0200
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Alice Ryhl" <aliceryhl@...gle.com>
Cc: "Maarten Lankhorst" <maarten.lankhorst@...ux.intel.com>, "Maxime Ripard"
<mripard@...nel.org>, "Thomas Zimmermann" <tzimmermann@...e.de>, "David
Airlie" <airlied@...il.com>, "Simona Vetter" <simona@...ll.ch>, "Boris
Brezillon" <boris.brezillon@...labora.com>, "Daniel Almeida"
<daniel.almeida@...labora.com>, "Steven Price" <steven.price@....com>,
"Liviu Dudau" <liviu.dudau@....com>, "Rob Clark"
<robin.clark@....qualcomm.com>, "Rob Herring" <robh@...nel.org>, "Miguel
Ojeda" <ojeda@...nel.org>, "Boqun Feng" <boqun.feng@...il.com>, "Gary Guo"
<gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Benno Lossin" <lossin@...nel.org>, "Andreas
Hindborg" <a.hindborg@...nel.org>, "Trevor Gross" <tmgross@...ch.edu>,
<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
<rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH v2 3/3] gpuvm: remove gem.gpuva.lock_dep_map
On Fri Aug 22, 2025 at 11:28 AM CEST, Alice Ryhl wrote:
> diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
> index 4a22b9d848f7b3d5710ca554f5b01556abf95985..598ba376b9430cdd4ab7bacdc15de031a887cf71 100644
> --- a/include/drm/drm_gpuvm.h
> +++ b/include/drm/drm_gpuvm.h
> @@ -196,10 +196,20 @@ enum drm_gpuvm_flags {
> */
> DRM_GPUVM_RESV_PROTECTED = BIT(0),
>
> + /**
> + * @DRM_GPUVM_IMMEDIATE_MODE: use the locking scheme that makes it safe
> + * to modify the GPUVM during the fence signalling path
I think this isn't entirely true yet or at least can be ambiguous for now,
because it doesn't prevent users from having DRM_GPUVM_RESV_PROTECTED set, which
requires the DMA resv lock to destroy a struct drm_gpuvm_bo, which may happen
from drm_gpuva_unlink().
So, for now, until we have the deferred drop idea in place, it also
requires DRM_GPUVM_RESV_PROTECTED to not be set.
(Eventually, we of course want both to be represented as a single flag, such
that it becomes an either or.)
I also wouldn't say "makes it safe to", but rather "makes it possible to
safely". We have no control over what the users do with the mutex. :)
NIT: missing period
> + *
> + * When set, gpuva.lock is used to protect gpuva.list in all GEM
> + * objects associated with this GPUVM. Otherwise, the GEMs dma-resv is
> + * used.
> + */
> + DRM_GPUVM_IMMEDIATE_MODE = BIT(1),
> +
> /**
> * @DRM_GPUVM_USERBITS: user defined bits
> */
> - DRM_GPUVM_USERBITS = BIT(1),
> + DRM_GPUVM_USERBITS = BIT(2),
> };
Powered by blists - more mailing lists