From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Matthew Auld" <matthew.auld@intel.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Himal Prasad Ghimiray" <himal.prasad.ghimiray@intel.com>
Subject: [PATCH 1/2] drm/xe/svm: Ensure data will be migrated to system if indicated by madvise.
Date: Wed, 8 Oct 2025 13:10:49 +0200 [thread overview]
Message-ID: <20251008111050.293151-2-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20251008111050.293151-1-thomas.hellstrom@linux.intel.com>
If the location madvise() is set to
DRM_XE_PREFERRED_LOC_DEFAULT_SYSTEM, the drm_pagemap in the
SVM gpu fault handler will be set to NULL. However there is nothing
that explicitly migrates the data to system if it is already present
in device memory.
In that case, set the device memory owner to NULL to ensure
data gets properly migrated to system on page-fault.
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
drivers/gpu/drm/xe/xe_svm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
index 7e2db71ff34e..fd906eb03d71 100644
--- a/drivers/gpu/drm/xe/xe_svm.c
+++ b/drivers/gpu/drm/xe/xe_svm.c
@@ -1034,6 +1034,9 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
if (err)
return err;
+ dpagemap = xe_vma_resolve_pagemap(vma, tile);
+ if (!dpagemap && !ctx.devmem_only)
+ ctx.device_private_page_owner = NULL;
range = xe_svm_range_find_or_insert(vm, fault_addr, vma, &ctx);
if (IS_ERR(range))
--
2.51.0
next prev parent reply other threads:[~2025-10-08 11:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 11:10 [PATCH 0/2] SVM migration fixes Thomas Hellström
2025-10-08 11:10 ` Thomas Hellström [this message]
2025-10-08 11:42 ` [PATCH 1/2] drm/xe/svm: Ensure data will be migrated to system if indicated by madvise Matthew Brost
2025-10-08 11:55 ` Matthew Brost
2025-10-08 16:32 ` Ghimiray, Himal Prasad
2025-10-08 11:10 ` [PATCH 2/2] drm/xe: Allow mixed mappings for userptr Thomas Hellström
2025-10-08 14:37 ` Matthew Auld
2025-10-08 11:18 ` ✓ CI.KUnit: success for SVM migration fixes Patchwork
2025-10-08 12:05 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-08 13:53 ` ✗ Xe.CI.Full: failure " 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=20251008111050.293151-2-thomas.hellstrom@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@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