All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 08/17] igt/gem_sync: Show the baseline poll latency for wakeups
Date: Mon,  2 Jul 2018 10:07:18 +0100	[thread overview]
Message-ID: <20180702090727.7721-8-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20180702090727.7721-1-chris@chris-wilson.co.uk>

Distinguish between the latency required to switch away from the
pollable spinner into the target nops from the client wakeup of
synchronisation on the last nop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 tests/gem_sync.c | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index 60d61a02e..493ae61df 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -207,7 +207,7 @@ wakeup_ring(int fd, unsigned ring, int timeout, int wlen)
 		const uint32_t bbe = MI_BATCH_BUFFER_END;
 		struct drm_i915_gem_exec_object2 object;
 		struct drm_i915_gem_execbuffer2 execbuf;
-		double end, this, elapsed, now;
+		double end, this, elapsed, now, baseline;
 		unsigned long cycles;
 		uint32_t cmd;
 		igt_spin_t *spin;
@@ -233,6 +233,32 @@ wakeup_ring(int fd, unsigned ring, int timeout, int wlen)
 		igt_spin_batch_end(spin);
 		gem_sync(fd, object.handle);
 
+		for (int warmup = 0; warmup <= 1; warmup++) {
+			end = gettime() + timeout/10.;
+			elapsed = 0;
+			cycles = 0;
+			do {
+				*spin->batch = cmd;
+				*spin->running = 0;
+				gem_execbuf(fd, &spin->execbuf);
+				while (!READ_ONCE(*spin->running))
+					;
+
+				this = gettime();
+				igt_spin_batch_end(spin);
+				gem_sync(fd, spin->handle);
+				now = gettime();
+
+				elapsed += now - this;
+				cycles++;
+			} while (now < end);
+			baseline = elapsed / cycles;
+		}
+		igt_info("%s%saseline %ld cycles: %.3f us\n",
+			 names[child % num_engines] ?: "",
+			 names[child % num_engines] ? " b" : "B",
+			 cycles, elapsed*1e6/cycles);
+
 		end = gettime() + timeout;
 		elapsed = 0;
 		cycles = 0;
@@ -254,16 +280,17 @@ wakeup_ring(int fd, unsigned ring, int timeout, int wlen)
 			elapsed += now - this;
 			cycles++;
 		} while (now < end);
+		elapsed -= cycles * baseline;
 
-		igt_info("%s%sompleted %ld cycles: %.3f us\n",
+		igt_info("%s%sompleted %ld cycles: %.3f + %.3f us\n",
 			 names[child % num_engines] ?: "",
 			 names[child % num_engines] ? " c" : "C",
-			 cycles, elapsed*1e6/cycles);
+			 cycles, 1e6*baseline, elapsed*1e6/cycles);
 
 		igt_spin_batch_free(fd, spin);
 		gem_close(fd, object.handle);
 	}
-	igt_waitchildren_timeout(timeout+10, NULL);
+	igt_waitchildren_timeout(2*timeout, NULL);
 	igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
 }
 
-- 
2.18.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 08/17] igt/gem_sync: Show the baseline poll latency for wakeups
Date: Mon,  2 Jul 2018 10:07:18 +0100	[thread overview]
Message-ID: <20180702090727.7721-8-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20180702090727.7721-1-chris@chris-wilson.co.uk>

Distinguish between the latency required to switch away from the
pollable spinner into the target nops from the client wakeup of
synchronisation on the last nop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 tests/gem_sync.c | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index 60d61a02e..493ae61df 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -207,7 +207,7 @@ wakeup_ring(int fd, unsigned ring, int timeout, int wlen)
 		const uint32_t bbe = MI_BATCH_BUFFER_END;
 		struct drm_i915_gem_exec_object2 object;
 		struct drm_i915_gem_execbuffer2 execbuf;
-		double end, this, elapsed, now;
+		double end, this, elapsed, now, baseline;
 		unsigned long cycles;
 		uint32_t cmd;
 		igt_spin_t *spin;
@@ -233,6 +233,32 @@ wakeup_ring(int fd, unsigned ring, int timeout, int wlen)
 		igt_spin_batch_end(spin);
 		gem_sync(fd, object.handle);
 
+		for (int warmup = 0; warmup <= 1; warmup++) {
+			end = gettime() + timeout/10.;
+			elapsed = 0;
+			cycles = 0;
+			do {
+				*spin->batch = cmd;
+				*spin->running = 0;
+				gem_execbuf(fd, &spin->execbuf);
+				while (!READ_ONCE(*spin->running))
+					;
+
+				this = gettime();
+				igt_spin_batch_end(spin);
+				gem_sync(fd, spin->handle);
+				now = gettime();
+
+				elapsed += now - this;
+				cycles++;
+			} while (now < end);
+			baseline = elapsed / cycles;
+		}
+		igt_info("%s%saseline %ld cycles: %.3f us\n",
+			 names[child % num_engines] ?: "",
+			 names[child % num_engines] ? " b" : "B",
+			 cycles, elapsed*1e6/cycles);
+
 		end = gettime() + timeout;
 		elapsed = 0;
 		cycles = 0;
@@ -254,16 +280,17 @@ wakeup_ring(int fd, unsigned ring, int timeout, int wlen)
 			elapsed += now - this;
 			cycles++;
 		} while (now < end);
+		elapsed -= cycles * baseline;
 
-		igt_info("%s%sompleted %ld cycles: %.3f us\n",
+		igt_info("%s%sompleted %ld cycles: %.3f + %.3f us\n",
 			 names[child % num_engines] ?: "",
 			 names[child % num_engines] ? " c" : "C",
-			 cycles, elapsed*1e6/cycles);
+			 cycles, 1e6*baseline, elapsed*1e6/cycles);
 
 		igt_spin_batch_free(fd, spin);
 		gem_close(fd, object.handle);
 	}
-	igt_waitchildren_timeout(timeout+10, NULL);
+	igt_waitchildren_timeout(2*timeout, NULL);
 	igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
 }
 
-- 
2.18.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2018-07-02  9:07 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02  9:07 [PATCH i-g-t 01/17] lib: Report file cache as available system memory Chris Wilson
2018-07-02  9:07 ` [Intel-gfx] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 02/17] igt/gem_tiled_partial_pwrite_pread: Check for known swizzling Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02 12:00   ` Tvrtko Ursulin
2018-07-02 12:00     ` Tvrtko Ursulin
2018-07-05 11:14     ` Chris Wilson
2018-07-05 11:14       ` [Intel-gfx] " Chris Wilson
2018-07-05 12:30       ` Tvrtko Ursulin
2018-07-05 12:30         ` [Intel-gfx] " Tvrtko Ursulin
2018-07-05 12:35         ` Chris Wilson
2018-07-05 12:35           ` [Intel-gfx] " Chris Wilson
2018-07-05 15:26           ` Tvrtko Ursulin
2018-07-05 15:26             ` [Intel-gfx] " Tvrtko Ursulin
2018-07-05 15:55             ` Chris Wilson
2018-07-05 15:55               ` Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 03/17] igt/gem_set_tiling_vs_pwrite: Show the erroneous value Chris Wilson
2018-07-02  9:07   ` [Intel-gfx] " Chris Wilson
2018-07-02 12:00   ` [igt-dev] " Tvrtko Ursulin
2018-07-02 12:00     ` Tvrtko Ursulin
2018-07-02  9:07 ` [PATCH i-g-t 04/17] lib: Convert spin batch constructor to a factory Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02 15:34   ` Tvrtko Ursulin
2018-07-02 15:34     ` Tvrtko Ursulin
2018-07-02  9:07 ` [PATCH i-g-t 05/17] lib: Spin fast, retire early Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02 15:36   ` Tvrtko Ursulin
2018-07-02 15:36     ` [Intel-gfx] " Tvrtko Ursulin
2018-07-05 11:23     ` Chris Wilson
2018-07-05 11:23       ` [igt-dev] [Intel-gfx] " Chris Wilson
2018-07-05 12:33       ` Tvrtko Ursulin
2018-07-05 12:33         ` [Intel-gfx] " Tvrtko Ursulin
2018-07-05 12:42         ` Chris Wilson
2018-07-05 12:42           ` [igt-dev] [Intel-gfx] " Chris Wilson
2018-07-05 15:29           ` Tvrtko Ursulin
2018-07-05 15:29             ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2018-07-05 15:52             ` Chris Wilson
2018-07-05 15:52               ` [igt-dev] [Intel-gfx] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 06/17] igt/gem_sync: Alternate stress for nop+sync Chris Wilson
2018-07-02  9:07   ` [Intel-gfx] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 07/17] igt/gem_sync: Double the wakeups, twice the pain Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02  9:07 ` Chris Wilson [this message]
2018-07-02  9:07   ` [igt-dev] [PATCH i-g-t 08/17] igt/gem_sync: Show the baseline poll latency for wakeups Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 09/17] igt/gem_userptr: Check read-only mappings Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 10/17] igt: Exercise creating context with shared GTT Chris Wilson
2018-07-02  9:07   ` [Intel-gfx] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 11/17] igt/gem_ctx_switch: Exercise queues Chris Wilson
2018-07-02  9:07   ` [Intel-gfx] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 12/17] igt/gem_exec_whisper: Fork all-engine tests one-per-engine Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 13/17] igt: Add gem_ctx_engines Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 14/17] igt: Add gem_exec_balancer Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 15/17] benchmarks/wsim: Simulate and interpret .wsim Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 16/17] tools: capture execution pathways Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02  9:07 ` [PATCH i-g-t 17/17] igt/gem_exec_latency: Robustify measurements Chris Wilson
2018-07-02  9:07   ` [igt-dev] " Chris Wilson
2018-07-02 11:54 ` [igt-dev] [PATCH i-g-t 01/17] lib: Report file cache as available system memory Tvrtko Ursulin
2018-07-02 11:54   ` Tvrtko Ursulin
2018-07-02 12:08   ` Chris Wilson
2018-07-02 12:08     ` Chris Wilson
2018-07-02 13:09 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/17] " Patchwork
2018-07-02 14:16 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20180702090727.7721-8-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.