Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/intel/xe_vm: Update mmap hammer sections to prefetch next page
@ 2024-04-30 22:16 Matthew Brost
  2024-04-30 23:13 ` ✓ CI.xeBAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matthew Brost @ 2024-04-30 22:16 UTC (permalink / raw)
  To: igt-dev; +Cc: Matthew Brost

Adjust mmap hammer sections to prefetch next page by moving BB to within
PAGE_SIZE /8 of page boundary. This is prefetch next page on all
platforms, even ones with a smaller prefetch size.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 tests/intel/xe_vm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
index de2b1a8136..77cf1f7e67 100644
--- a/tests/intel/xe_vm.c
+++ b/tests/intel/xe_vm.c
@@ -1623,10 +1623,11 @@ test_mmap_style_bind(int fd, struct drm_xe_engine_class_instance *eci,
 		t.fd = fd;
 		t.vm = vm;
 #define PAGE_SIZE	4096
-		t.addr = addr + PAGE_SIZE / 2;
+#define HAMMER_OFFSET	(PAGE_SIZE - (PAGE_SIZE / 32))
+		t.addr = addr + HAMMER_OFFSET;
 		t.eci = eci;
 		t.exit = &exit;
-		t.map = map0 + PAGE_SIZE / 2;
+		t.map = map0 + HAMMER_OFFSET;
 		t.barrier = &barrier;
 		pthread_barrier_init(&barrier, NULL, 2);
 		pthread_create(&t.thread, 0, hammer_thread, &t);
@@ -1685,7 +1686,7 @@ test_mmap_style_bind(int fd, struct drm_xe_engine_class_instance *eci,
 		igt_assert_eq(data->data, 0xc0ffee);
 	}
 	if (flags & MAP_FLAG_HAMMER_FIRST_PAGE) {
-		memset(map0, 0, PAGE_SIZE / 2);
+		memset(map0, 0, HAMMER_OFFSET);
 		memset(map0 + PAGE_SIZE, 0, bo_size - PAGE_SIZE);
 	} else {
 		memset(map0, 0, bo_size);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-01 18:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30 22:16 [PATCH] tests/intel/xe_vm: Update mmap hammer sections to prefetch next page Matthew Brost
2024-04-30 23:13 ` ✓ CI.xeBAT: success for " Patchwork
2024-04-30 23:15 ` ✓ Fi.CI.BAT: " Patchwork
2024-05-01  5:28 ` ✗ CI.xeFULL: failure " Patchwork
2024-05-01 16:57 ` [PATCH] " Randhawa, Jagmeet
2024-05-01 18:46 ` ✗ Fi.CI.IGT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox