From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
intel-xe@lists.freedesktop.org
Cc: <matthew.brost@intel.com>
Subject: Re: [PATCH v6 19/20] drm/xe/svm: Implement prefetch support for SVM ranges
Date: Fri, 2 May 2025 20:05:14 +0530 [thread overview]
Message-ID: <6206f91e-aef4-400f-891c-6b11bbe4ffca@intel.com> (raw)
In-Reply-To: <62989f8bbb1d8f57fea227f7afdbc753b492dbcf.camel@linux.intel.com>
On 02-05-2025 19:12, Thomas Hellström wrote:
> On Wed, 2025-04-30 at 17:49 +0530, Himal Prasad Ghimiray wrote:
>> This commit adds prefetch support for SVM ranges, utilizing the
>> existing ioctl vm_bind functionality to achieve this.
>>
>> v2: rebase
>>
>> v3:
>> - use xa_for_each() instead of manual loop
>> - check range is valid and in preferred location before adding to
>> xarray
>> - Fix naming conventions
>> - Fix return condition as -ENODATA instead of -EAGAIN (Matthew
>> Brost)
>> - Handle sparsely populated cpu vma range (Matthew Brost)
>>
>> v4:
>> - fix end address to find next cpu vma in case of -ENOENT
>>
>> v5:
>> - Move find next vma logic to drm gpusvm layer
>> - Avoid mixing declaration and logic
>>
>> v6:
>> - Use new function names
>> - Move eviction logic to prefetch_ranges
>>
>> Cc: Matthew Brost <matthew.brost@intel.com>
>> Signed-off-by: Himal Prasad Ghimiray
>> <himal.prasad.ghimiray@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_pt.c | 58 ++++++++---
>> drivers/gpu/drm/xe/xe_vm.c | 197
>> +++++++++++++++++++++++++++++++++++--
>> 2 files changed, 234 insertions(+), 21 deletions(-)
>>
>
> I was thinking a bit around the UAPI, and prefetching foreign device
> regions. That doesn't really fit into the current UAPI.
>
> What are your thoughts here. IMO this should align somewhat to what we
> do for madvise().
>
> Let's say we want to prefetch into a foreign device memory region
> identified by an fd? I figure we could add that later as an extension.
>
> But how does the UMD API for this look? Do we cover current usage with
> the existing UAPI syntax?
During Initial discussions one of the way we discussed was using a flag
something like DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC for prefetch to
madvise assigned preferred location.
so it will be two step process from UMD perspective:
1) madvise sets up preferred location: which should also be used in
pagefault handler.
2) If user wants to prefetch to same location, user passes region as
DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC to vm_bind ioctl.
https://patchwork.freedesktop.org/patch/647180/?series=146290&rev=4
or we can simply pass u32 devmem_fd as prefetch_mem_region_instance to
vm_bind ioctl, if we want it to be single step, but w/o madvise that
wont work for pf handler.
/Himal>
> /Thomas
>
next prev parent reply other threads:[~2025-05-02 14:35 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 12:18 [PATCH v6 00/20] Prefetch Support for svm ranges Himal Prasad Ghimiray
2025-04-30 12:18 ` [PATCH v6 01/20] drm/gpusvm: Introduce devmem_only flag for allocation Himal Prasad Ghimiray
2025-04-30 12:18 ` [PATCH v6 02/20] drm/xe: Strict migration policy for atomic SVM faults Himal Prasad Ghimiray
2025-05-05 15:20 ` Thomas Hellström
2025-05-05 20:18 ` Matthew Brost
2025-05-06 10:13 ` Thomas Hellström
2025-05-06 14:59 ` Matthew Brost
2025-04-30 12:18 ` [PATCH v6 03/20] drm/gpusvm: Add timeslicing support to GPU SVM Himal Prasad Ghimiray
2025-04-30 12:18 ` [PATCH v6 04/20] drm/xe: Timeslice GPU on atomic SVM fault Himal Prasad Ghimiray
2025-04-30 12:18 ` [PATCH v6 05/20] drm/xe: Add atomic_svm_timeslice_ms debugfs entry Himal Prasad Ghimiray
2025-04-30 12:18 ` [PATCH v6 06/20] drm/xe: Introduce xe_vma_op_prefetch_range struct for prefetch of ranges Himal Prasad Ghimiray
2025-04-30 12:18 ` [PATCH v6 07/20] drm/xe: Make xe_svm_alloc_vram public Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 08/20] drm/xe/svm: Helper to add tile masks to svm ranges Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 09/20] drm/xe/svm: Make to_xe_range a public function Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 10/20] drm/xe/svm: Make xe_svm_range_* end/start/size public Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 11/20] drm/xe/vm: Update xe_vma_ops_incr_pt_update_ops to take an increment value Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 12/20] drm/xe/vm: Add an identifier in xe_vma_ops for svm prefetch Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 13/20] drm/xe: Rename lookup_vma function to xe_find_vma_by_addr Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 14/20] drm/xe/svm: Refactor usage of drm_gpusvm* function in xe_svm Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 15/20] drm/xe/svm: Make xe_svm_range_needs_migrate_to_vram() public Himal Prasad Ghimiray
2025-04-30 12:19 ` [PATCH v6 16/20] drm/xe/svm: Add xe_svm_range_validate() and xe_svm_range_migrate_to_smem() Himal Prasad Ghimiray
2025-04-30 14:50 ` Matthew Brost
2025-04-30 12:19 ` [PATCH v6 17/20] drm/gpusvm: Introduce drm_gpusvm_find_vma_start() function Himal Prasad Ghimiray
2025-04-30 15:03 ` Matthew Brost
2025-04-30 12:19 ` [PATCH v6 18/20] drm/xe/svm: Add xe_svm_find_vma_start() helper Himal Prasad Ghimiray
2025-04-30 16:35 ` Matthew Brost
2025-04-30 12:19 ` [PATCH v6 19/20] drm/xe/svm: Implement prefetch support for SVM ranges Himal Prasad Ghimiray
2025-05-02 13:42 ` Thomas Hellström
2025-05-02 14:35 ` Ghimiray, Himal Prasad [this message]
2025-05-02 14:39 ` Thomas Hellström
2025-05-02 16:11 ` Ghimiray, Himal Prasad
2025-05-07 11:39 ` Thomas Hellström
2025-05-12 12:48 ` Matthew Brost
2025-05-12 12:56 ` Ghimiray, Himal Prasad
2025-04-30 12:19 ` [PATCH v6 20/20] drm/xe/vm: Add debug prints for SVM range prefetch Himal Prasad Ghimiray
2025-04-30 12:45 ` ✓ CI.Patch_applied: success for Prefetch Support for svm ranges (rev5) Patchwork
2025-04-30 12:45 ` ✓ CI.checkpatch: " Patchwork
2025-04-30 12:46 ` ✓ CI.KUnit: " Patchwork
2025-04-30 13:06 ` ✓ CI.Build: " Patchwork
2025-04-30 13:08 ` ✓ CI.Hooks: " Patchwork
2025-04-30 13:10 ` ✓ CI.checksparse: " Patchwork
2025-04-30 20:06 ` ✗ Xe.CI.Full: failure " Patchwork
2025-05-06 7:55 ` ✓ Xe.CI.BAT: success " Patchwork
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=6206f91e-aef4-400f-891c-6b11bbe4ffca@intel.com \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox