Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 Auld <matthew.auld@intel.com>,
	Matthew Brost <matthew.brost@intel.com>
Subject: Re: [PATCH 1/2] drm/xe/svm: Ensure data will be migrated to system if indicated by madvise.
Date: Wed, 8 Oct 2025 22:02:52 +0530	[thread overview]
Message-ID: <019f20d1-6823-4907-bab1-fa801336b976@intel.com> (raw)
In-Reply-To: <20251008111050.293151-2-thomas.hellstrom@linux.intel.com>



On 08-10-2025 16:40, Thomas Hellström wrote:
> 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);


remove redundant dpagemap assignment before 
xe_svm_range_needs_migrate_to_vram check.

  >
>   	if (IS_ERR(range))


  parent reply	other threads:[~2025-10-08 16:33 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 ` [PATCH 1/2] drm/xe/svm: Ensure data will be migrated to system if indicated by madvise Thomas Hellström
2025-10-08 11:42   ` Matthew Brost
2025-10-08 11:55     ` Matthew Brost
2025-10-08 16:32   ` Ghimiray, Himal Prasad [this message]
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=019f20d1-6823-4907-bab1-fa801336b976@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --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