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

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 12 11:14:37 UTC 2018


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 at chris-wilson.co.uk>
---
 tests/gem_exec_await.c | 7 +++++++
 1 file changed, 7 insertions(+)

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;
-- 
2.19.0



More information about the igt-dev mailing list