From: Caterina Shablia <caterina.shablia@collabora.com>
To: Danilo Krummrich <dakr@kernel.org>,
Matthew Brost <matthew.brost@intel.com>
Cc: "Himal Prasad Ghimiray" <himal.prasad.ghimiray@intel.com>,
intel-xe@lists.freedesktop.org,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Danilo Krummrich" <dakr@redhat.com>,
"Boris Brezillon" <bbrezillon@kernel.org>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 01/23] Introduce drm_gpuvm_sm_map_ops_flags enums for sm_map_ops
Date: Thu, 24 Jul 2025 12:32:37 +0200 [thread overview]
Message-ID: <2304014.vFx2qVVIhK@xps> (raw)
In-Reply-To: <aIGBzCnTAcyb6v1H@lstrano-desk.jf.intel.com>
El jueves, 24 de julio de 2025 2:43:56 (hora de verano de Europa central),
Matthew Brost escribió:
> On Tue, Jul 22, 2025 at 03:38:14PM +0200, Danilo Krummrich wrote:
> > (Cc: Caterina)
> >
> > On Tue Jul 22, 2025 at 3:35 PM CEST, Himal Prasad Ghimiray wrote:
> > > - DRM_GPUVM_SM_MAP_NOT_MADVISE: Default sm_map operations for the input
> > >
> > > range.
> > >
> > > - DRM_GPUVM_SKIP_GEM_OBJ_VA_SPLIT_MADVISE: This flag is used by
> > >
> > > drm_gpuvm_sm_map_ops_create to iterate over GPUVMA's in the
> > >
> > > user-provided range and split the existing non-GEM object VMA if the
> > > start or end of the input range lies within it. The operations can
> > > create up to 2 REMAPS and 2 MAPs. The purpose of this operation is to be
> > > used by the Xe driver to assign attributes to GPUVMA's within the
> > > user-defined range. Unlike drm_gpuvm_sm_map_ops_flags in default mode,
> > > the operation with this flag will never have UNMAPs and
> > > merges, and can be without any final operations.
> > >
> > > v2
> > > - use drm_gpuvm_sm_map_ops_create with flags instead of defining new
> > >
> > > ops_create (Danilo)
> > >
> > > - Add doc (Danilo)
> > >
> > > v3
> > > - Fix doc
> > > - Fix unmapping check
> > >
> > > v4
> > > - Fix mapping for non madvise ops
> > >
> > > Cc: Danilo Krummrich <dakr@redhat.com>
> > > Cc: Matthew Brost <matthew.brost@intel.com>
> > > Cc: Boris Brezillon <bbrezillon@kernel.org>
> > > Cc: <dri-devel@lists.freedesktop.org>
> > > Signed-off-by: Himal Prasad Ghimiray<himal.prasad.ghimiray@intel.com>
> > > ---
> > >
> > > drivers/gpu/drm/drm_gpuvm.c | 93 ++++++++++++++++++++------
> > > drivers/gpu/drm/nouveau/nouveau_uvmm.c | 1 +
> > > drivers/gpu/drm/xe/xe_vm.c | 1 +
> >
> > What about the other drivers using GPUVM, aren't they affected by the
> > changes?
> Yes, this seemly would break the build or other users. If the baseline
> includes the patch below that I suggest to pull in this is a moot point
> though.
>
> > > include/drm/drm_gpuvm.h | 25 ++++++-
> > > 4 files changed, 98 insertions(+), 22 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c
> > > index e89b932e987c..c7779588ea38 100644
> > > --- a/drivers/gpu/drm/drm_gpuvm.c
> > > +++ b/drivers/gpu/drm/drm_gpuvm.c
> > > @@ -2103,10 +2103,13 @@ static int
> > >
> > > __drm_gpuvm_sm_map(struct drm_gpuvm *gpuvm,
> > >
> > > const struct drm_gpuvm_ops *ops, void *priv,
> > > u64 req_addr, u64 req_range,
> > >
> > > + enum drm_gpuvm_sm_map_ops_flags flags,
> >
> > Please coordinate with Boris and Caterina here. They're adding a new
> > request structure, struct drm_gpuvm_map_req.
> >
> > I think we can define it as
> >
> > struct drm_gpuvm_map_req {
> >
> > struct drm_gpuva_op_map map;
> > struct drm_gpuvm_sm_map_ops_flags flags;
> >
> > }
>
> +1, I see the patch [2] and the suggested change to drm_gpuva_op_map
> [3]. Both patch and your suggestion look good to me.
>
> Perhaps we try to accelerate [2] landing ahead of either series as
> overall just looks like a good cleanup which can be merged asap.
I'm not sure my patchset would be in a mergeable state any time soon -- I've
discovered some issues with split/merge of repeated mappings while writing the
doc, so it will be a while before I'll be submitting that again. [2] itself is
in a good shape, absolutely feel free to submit that as part of your series.
>
> Himal - I'd rebase on top [2], with Danilo suggestion in [3] if this
> hasn't landed by your next rev.
>
> [2]
> https://lore.kernel.org/all/20250707170442.1437009-4-caterina.shablia@colla
> bora.com/ [3]
> https://lore.kernel.org/all/DB61N61AKIJ3.FG7GUJBG386P@kernel.org/
> > eventually.
> >
> > Please also coordinate on the changes in __drm_gpuvm_sm_map() below
> > regarding Caterina's series [1], it looks like they're conflicting.
>
> It looks pretty minor actually. I'm sure if really matter who this is
> race but yes, always good to coordinate.
>
> > [1]
> > https://lore.kernel.org/all/20250707170442.1437009-1-caterina.shablia@col
> > labora.com/>
> > > +/**
> > > + * enum drm_gpuvm_sm_map_ops_flags - flags for drm_gpuvm split/merge
> > > ops
> > > + */
> > > +enum drm_gpuvm_sm_map_ops_flags {
> > > + /**
> > > + * @DRM_GPUVM_SM_MAP_NOT_MADVISE: DEFAULT sm_map ops
> > > + */
> > > + DRM_GPUVM_SM_MAP_NOT_MADVISE = 0,
> >
> > Why would we name this "NOT_MADVISE"? What if we add more flags for other
> > purposes?
>
> How about...
>
> s/DRM_GPUVM_SM_MAP_NOT_MADVISE/DRM_GPUVM_SM_MAP_OPS_FLAG_NONE/
>
> > > + /**
> > > + * @DRM_GPUVM_SKIP_GEM_OBJ_VA_SPLIT_MADVISE: This flag is used by
> > > + * drm_gpuvm_sm_map_ops_create to iterate over GPUVMA's in the
> > > + * user-provided range and split the existing non-GEM object VMA
if
> > > the
> > > + * start or end of the input range lies within it. The operations
can
> > > + * create up to 2 REMAPS and 2 MAPs. Unlike
drm_gpuvm_sm_map_ops_flags
> > > + * in default mode, the operation with this flag will never have
> > > UNMAPs and + * merges, and can be without any final operations.
> > > + */
> > > + DRM_GPUVM_SKIP_GEM_OBJ_VA_SPLIT_MADVISE = BIT(0),
>
> Then normalize this one...
>
> s/DRM_GPUVM_SKIP_GEM_OBJ_VA_SPLIT_MADVISE/DRM_GPUVM_SM_MAP_OPS_FLAG_SPLIT_MA
> DVISE/
>
> Matt
>
> > > +};
next prev parent reply other threads:[~2025-07-24 10:32 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 13:35 [PATCH v5 00/23] MADVISE FOR XE Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 01/23] Introduce drm_gpuvm_sm_map_ops_flags enums for sm_map_ops Himal Prasad Ghimiray
2025-07-22 13:38 ` Danilo Krummrich
2025-07-24 0:43 ` Matthew Brost
2025-07-24 10:05 ` Ghimiray, Himal Prasad
2025-07-24 10:32 ` Caterina Shablia [this message]
2025-07-28 10:20 ` Ghimiray, Himal Prasad
2025-07-24 10:02 ` Ghimiray, Himal Prasad
2025-07-27 21:18 ` Matthew Brost
2025-07-28 6:16 ` Ghimiray, Himal Prasad
2025-07-22 13:35 ` [PATCH v5 02/23] drm/xe/uapi: Add madvise interface Himal Prasad Ghimiray
2025-07-29 3:29 ` Matthew Brost
2025-07-22 13:35 ` [PATCH v5 03/23] drm/xe/vm: Add attributes struct as member of vma Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 04/23] drm/xe/vma: Move pat_index to vma attributes Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 05/23] drm/xe/vma: Modify new_vma to accept struct xe_vma_mem_attr as parameter Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 06/23] drm/gpusvm: Make drm_gpusvm_for_each_* macros public Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 07/23] drm/xe/svm: Split system allocator vma incase of madvise call Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 08/23] drm/xe: Allow CPU address mirror VMA unbind with gpu bindings for madvise Himal Prasad Ghimiray
2025-07-29 3:40 ` Matthew Brost
2025-07-29 7:42 ` Ghimiray, Himal Prasad
2025-07-22 13:35 ` [PATCH v5 09/23] drm/xe/svm: Add xe_svm_ranges_zap_ptes_in_range() for PTE zapping Himal Prasad Ghimiray
2025-07-29 3:42 ` Matthew Brost
2025-07-22 13:35 ` [PATCH v5 10/23] drm/xe: Implement madvise ioctl for xe Himal Prasad Ghimiray
2025-07-29 3:52 ` Matthew Brost
2025-07-29 4:23 ` Matthew Brost
2025-07-29 9:43 ` Ghimiray, Himal Prasad
2025-07-22 13:35 ` [PATCH v5 11/23] drm/xe/svm : Add svm ranges migration policy on atomic access Himal Prasad Ghimiray
2025-07-29 4:04 ` Matthew Brost
2025-07-30 4:59 ` Ghimiray, Himal Prasad
2025-07-22 13:35 ` [PATCH v5 12/23] drm/xe/madvise: Update migration policy based on preferred location Himal Prasad Ghimiray
2025-07-29 4:07 ` Matthew Brost
2025-07-22 13:35 ` [PATCH v5 13/23] drm/xe/svm: Support DRM_XE_SVM_ATTR_PAT memory attribute Himal Prasad Ghimiray
2025-07-23 16:55 ` Ghimiray, Himal Prasad
2025-07-22 13:35 ` [PATCH v5 14/23] drm/xe/uapi: Add flag for consulting madvise hints on svm prefetch Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 15/23] drm/xe/svm: Consult madvise preferred location in prefetch Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 16/23] drm/xe/bo: Add attributes field to xe_bo Himal Prasad Ghimiray
2025-07-22 13:35 ` [PATCH v5 17/23] drm/xe/bo: Update atomic_access attribute on madvise Himal Prasad Ghimiray
2025-07-29 4:18 ` Matthew Brost
2025-07-22 13:35 ` [PATCH v5 18/23] drm/xe/madvise: Skip vma invalidation if mem attr are unchanged Himal Prasad Ghimiray
2025-07-29 4:19 ` Matthew Brost
2025-07-22 13:35 ` [PATCH v5 19/23] drm/xe/vm: Add helper to check for default VMA memory attributes Himal Prasad Ghimiray
2025-07-29 4:33 ` Matthew Brost
2025-07-22 13:35 ` [PATCH v5 20/23] drm/xe: Reset VMA attributes to default in SVM garbage collector Himal Prasad Ghimiray
2025-07-24 21:50 ` Matthew Brost
2025-07-29 5:27 ` Matthew Brost
2025-07-30 6:09 ` Ghimiray, Himal Prasad
2025-07-29 5:41 ` Matthew Brost
2025-07-30 6:06 ` Ghimiray, Himal Prasad
2025-07-22 13:35 ` [PATCH v5 21/23] drm/xe/vm: Add a delayed worker to merge fragmented vmas Himal Prasad Ghimiray
2025-07-29 4:39 ` Matthew Brost
2025-07-30 11:08 ` Ghimiray, Himal Prasad
2025-07-22 13:35 ` [PATCH v5 22/23] drm/xe: Enable madvise ioctl for xe Himal Prasad Ghimiray
2025-07-29 4:34 ` Matthew Brost
2025-07-22 13:35 ` [PATCH v5 23/23] drm/xe/uapi: Add UAPI for querying VMA count and memory attributes Himal Prasad Ghimiray
2025-07-29 5:37 ` Matthew Brost
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=2304014.vFx2qVVIhK@xps \
--to=caterina.shablia@collabora.com \
--cc=bbrezillon@kernel.org \
--cc=dakr@kernel.org \
--cc=dakr@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=thomas.hellstrom@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.