diff mbox series

[i-g-t] igt/gem_exec_await: Flush vm caches between runs

Message ID 20180912111437.21323-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [i-g-t] igt/gem_exec_await: Flush vm caches between runs | expand

Commit Message

Chris Wilson Sept. 12, 2018, 11:14 a.m. UTC
On allocating a request, we apply some backpressure if we fail to
allocate a request. The backpressure we apply involves waiting for the
device to idle, causing a stall on the clients (trying to throttle heavy
allocators) and as we may be inside a plugged critical section, the only
way to idle the GPU is by waiting for hangcheck to kick in.

Try to avoid the allocation failure by trimming the VM caches between
iterations.

References: https://bugs.freedesktop.org/show_bug.cgi?id=106680
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_exec_await.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/tests/gem_exec_await.c b/tests/gem_exec_await.c
index 5cfeb8ec8..b9a2c6105 100644
--- a/tests/gem_exec_await.c
+++ b/tests/gem_exec_await.c
@@ -147,6 +147,13 @@  static void wide(int fd, int ring_size, int timeout, unsigned int flags)
 	count = 0;
 	igt_until_timeout(timeout) {
 		struct timespec start, now;
+
+		/*
+		 * Flush all caches between runs, we do not want to encounter
+		 * reclaim in the middle of the plugged critical section.
+		 */
+		intel_purge_vm_caches(fd);
+
 		for (unsigned e = 0; e < nengine; e++) {
 			uint64_t address;
 			int i;