Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [i-g-t v2] tests/intel/xe_madvise: Skip purge tests under low RAM
@ 2026-06-12  4:50 Arvind Yadav
  2026-06-12  6:52 ` ✓ Xe.CI.BAT: success for tests/intel/xe_madvise: Skip purge tests under low RAM (rev2) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arvind Yadav @ 2026-06-12  4:50 UTC (permalink / raw)
  To: igt-dev; +Cc: nishit.sharma, pravalika.gurram, kamil.konieczny

The purge tests create memory pressure to trigger BO eviction. If the
system is already low on RAM, this extra pressure can push the machine
into OOM and kill the test before it can clean up.

Check available RAM before starting the pressure allocation and skip when
there is not enough memory.

v2:
  - Drop unrelated chunk/max_t() changes. (Kamil)
  - Keep the original overpressure calculation. (Kamil)

Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Pravalika Gurram <pravalika.gurram@intel.com>
Cc: Nishit Sharma <nishit.sharma@intel.com>
Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
---
 tests/intel/xe_madvise.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_madvise.c b/tests/intel/xe_madvise.c
index cdb115d7e..3fc8b5f65 100644
--- a/tests/intel/xe_madvise.c
+++ b/tests/intel/xe_madvise.c
@@ -101,11 +101,17 @@ static void trigger_memory_pressure(int fd)
 	overpressure = mem_size / 2;
 	if (overpressure < (64 << 20))
 		overpressure = 64 << 20;
+	max_objs = DIV_ROUND_UP(mem_size + overpressure, chunk);
+
+	/*
+	 * Pressure BOs are faulted in and kept alive until cleanup. If the
+	 * system is already low on RAM, this can cause OOM.
+	 */
+	igt_require_memory(max_objs, chunk, CHECK_RAM);
 
 	/* Separate VM so pressure BOs don't interfere with the test */
 	vm = xe_vm_create(fd, 0, 0);
 
-	max_objs = (mem_size + overpressure) / chunk + 1;
 	handles = malloc(max_objs * sizeof(*handles));
 	igt_assert(handles);
 
-- 
2.43.0


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

end of thread, other threads:[~2026-06-12  9:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12  4:50 [i-g-t v2] tests/intel/xe_madvise: Skip purge tests under low RAM Arvind Yadav
2026-06-12  6:52 ` ✓ Xe.CI.BAT: success for tests/intel/xe_madvise: Skip purge tests under low RAM (rev2) Patchwork
2026-06-12  6:55 ` ✓ i915.CI.BAT: " Patchwork
2026-06-12  9:04 ` [i-g-t v2] tests/intel/xe_madvise: Skip purge tests under low RAM Sokolowski, Jan
2026-06-12  9:13 ` Sebastian Brzezinka

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