All of lore.kernel.org
 help / color / mirror / Atom feed
From: nishit.sharma@intel.com
To: igt-dev@lists.freedesktop.org, kamil.konieczny@intel.com
Subject: [PATCH] tests/intel/xe_exec_system_allocator: fix prefetch-change-attr and DONTNEED flag handling
Date: Tue, 18 Aug 2026 14:29:56 +0000	[thread overview]
Message-ID: <20260818142956.577956-1-nishit.sharma@intel.com> (raw)

From: Nishit Sharma <nishit.sharma@intel.com>

These changes fixes the prefetch-change-attr test flow so the intended
prefetch and atomic-attribute transition execute in the correct path,
and it also switches the skip-results condition to use the proper internal
test flag (USE_MADV_DONTNEED) instead of the libc MADV_DONTNEED constant.
Together, these updates remove dead-path behavior, make the intent explicit
and improve reliability of the affected system-allocator IGT coverage
across platforms.

Signed-off-by: Nishit Sharma <nishit.sharma@intel.com>
---
 tests/intel/xe_exec_system_allocator.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_exec_system_allocator.c b/tests/intel/xe_exec_system_allocator.c
index 6ca53aa5f..305512dfd 100644
--- a/tests/intel/xe_exec_system_allocator.c
+++ b/tests/intel/xe_exec_system_allocator.c
@@ -1395,6 +1395,9 @@ madvise_prefetch_op(int fd, uint32_t vm, uint64_t addr, size_t bo_size,
 
 		xe_vm_madvise_migrate_pages(fd, vm, to_user_pointer(data), bo_size / 2);
 
+		/* free 1st allocation in mem_attrs */
+		free(mem_attrs);
+
 		mem_attrs = xe_vm_get_mem_attr_values_in_range(fd, vm, addr, bo_size, &num_ranges);
 		if (!mem_attrs) {
 			igt_info("Failed to get memory attributes\n");
@@ -1426,13 +1429,14 @@ madvise_prefetch_op(int fd, uint32_t vm, uint64_t addr, size_t bo_size,
 		if (!mem_attrs) {
 			igt_info("Failed to get memory attributes\n");
 			return;
+		}
 
 		xe_vm_prefetch_async(fd, vm, 0, 0, addr, bo_size, NULL, 0,
 				     DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC);
 
 		xe_vm_madvise_atomic_attr(fd, vm, to_user_pointer(data), bo_size,
 					  DRM_XE_ATOMIC_DEVICE);
-		}
+
 		free(mem_attrs);
 	}
 }
@@ -2333,7 +2337,7 @@ test_compute(int fd, struct drm_xe_engine_class_instance *eci, size_t size,
 	xe_wait_ufence(fd, &bo_sync->sync, USER_FENCE_VALUE, 0, FIVE_SEC);
 
 	env.loop_count = (flags & TOUCH_ONCE) ? 1 : env.array_size;
-	env.skip_results_check = !(flags & ACCESS_DEVICE_HOST) || (flags & MADV_DONTNEED);
+	env.skip_results_check = !(flags & ACCESS_DEVICE_HOST) || (flags & USE_MADV_DONTNEED);
 	env.vm = vm;
 
 	read_gt_stats_snapshot(fd, eci, &stats_before);
-- 
2.43.0


             reply	other threads:[~2026-08-18 14:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 14:29 nishit.sharma [this message]
2026-08-18 15:03 ` ✓ Xe.CI.BAT: success for tests/intel/xe_exec_system_allocator: fix prefetch-change-attr and DONTNEED flag handling Patchwork
2026-08-18 15:20 ` ✗ i915.CI.BAT: failure " Patchwork
2026-08-18 18:04 ` ✓ Xe.CI.FULL: success " Patchwork
2026-08-19 11:13 ` [PATCH] " Kamil Konieczny

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=20260818142956.577956-1-nishit.sharma@intel.com \
    --to=nishit.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@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.