Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas, Sobin" <sobin.thomas@intel.com>
To: Jia Yao <jia.yao@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH] xe_exec_system_allocator: fix PREFETCH_SPLIT_VMA bo_size for PVC
Date: Thu, 4 Jun 2026 22:08:01 +0530	[thread overview]
Message-ID: <08a9c871-8829-45ff-8db8-734ff2ec82a7@intel.com> (raw)
In-Reply-To: <20260504223717.1080309-1-jia.yao@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2234 bytes --]

LGTM.

Reviewed-by: Sobin Thomas <sobin.thomas@intel.com>


On 5/5/2026 4:07 AM, Jia Yao wrote:
> The PREFETCH_SPLIT_VMA subtest splits a buffer in half and relies on a
> GPU atomic fault to trigger SVM migration of the first half to VRAM.
> On PVC (XE_VRAM_FLAGS_NEED64K), xe_svm_range_needs_migrate_to_vram()
> rejects ranges smaller than 64K, so when bo_size=SZ_64K the 32K split
> half never migrates, causing an atomic timeout.
>
> Fix by passing SZ_128K as bo_size for PREFETCH_SPLIT_VMA subtests so
> each half is exactly 64K, and align bo_size to 64K inside
> madvise_prefetch_op() to match the granularity PVC requires.
>
> Cc: Sobin Thomas<sobin.thomas@intel.com>
> Signed-off-by: Jia Yao<jia.yao@intel.com>
> ---
>   tests/intel/xe_exec_system_allocator.c | 19 ++++++++++++++++---
>   1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/tests/intel/xe_exec_system_allocator.c b/tests/intel/xe_exec_system_allocator.c
> index 5580099f7..deef7626c 100644
> --- a/tests/intel/xe_exec_system_allocator.c
> +++ b/tests/intel/xe_exec_system_allocator.c
> @@ -1380,7 +1380,10 @@ madvise_prefetch_op(int fd, uint32_t vm, uint64_t addr, size_t bo_size,
>   	uint32_t num_ranges;
>   
>   	if (flags & PREFETCH_SPLIT_VMA) {
> -		bo_size = ALIGN(bo_size, SZ_4K);
> +		uint16_t dev_id = intel_get_drm_devid(fd);
> +		size_t alignment = IS_PONTEVECCHIO(dev_id) ? SZ_64K : SZ_4K;
> +
> +		bo_size = ALIGN(bo_size, alignment);
>   
>   		xe_vm_prefetch_async(fd, vm, 0, 0, addr, bo_size, NULL, 0, 0);
>   
> @@ -2751,9 +2754,19 @@ int igt_main()
>   
>   	for (const struct section *s = msections; s->name; s++) {
>   		igt_subtest_f("madvise-%s", s->name) {
> -			xe_for_each_engine(fd, hwe)
> -				test_exec(fd, hwe, 1, 1, SZ_64K, 0, 0, NULL,
> +			xe_for_each_engine(fd, hwe) {
> +				/*
> +				 * PREFETCH_SPLIT_VMA splits the buffer in half
> +				 * and migrates the first half. On platforms with
> +				 * 64K VRAM granularity (e.g. PVC), each half
> +				 * must be >= 64K, so use SZ_128K as bo_size.
> +				 */
> +				size_t bo_size = (s->flags & PREFETCH_SPLIT_VMA) ?
> +						 SZ_128K : SZ_64K;
> +
> +				test_exec(fd, hwe, 1, 1, bo_size, 0, 0, NULL,
>   					  NULL, s->flags, NULL);
> +			}
>   		}
>   	}
>   

[-- Attachment #2: Type: text/html, Size: 38203 bytes --]

      parent reply	other threads:[~2026-06-04 16:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 22:37 [PATCH] xe_exec_system_allocator: fix PREFETCH_SPLIT_VMA bo_size for PVC Jia Yao
2026-05-04 23:59 ` ✓ i915.CI.BAT: success for " Patchwork
2026-05-05  0:34 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-05  6:00 ` ✗ i915.CI.Full: failure " Patchwork
2026-05-05  7:16 ` ✓ Xe.CI.FULL: success " Patchwork
2026-06-04 16:38 ` Thomas, Sobin [this message]

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=08a9c871-8829-45ff-8db8-734ff2ec82a7@intel.com \
    --to=sobin.thomas@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jia.yao@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