All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests
@ 2018-02-19 22:18 Chris Wilson
  2018-02-19 22:18 ` [PATCH igt 2/2] lib: Cache the debugfs mountpoint Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Chris Wilson @ 2018-02-19 22:18 UTC (permalink / raw)
  To: intel-gfx

Don't just wait for the batch to be completed, wait for the system to
idle! Then wake it up and do it again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_sync.c | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index ad43b1a3..d70515ea 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -152,6 +152,45 @@ sync_ring(int fd, unsigned ring, int num_children, int timeout)
 	igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
 }
 
+static void
+idle_ring(int fd, unsigned ring, int timeout)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	struct drm_i915_gem_exec_object2 object;
+	struct drm_i915_gem_execbuffer2 execbuf;
+	double start, elapsed;
+	unsigned long cycles;
+
+	gem_require_ring(fd, ring);
+
+	memset(&object, 0, sizeof(object));
+	object.handle = gem_create(fd, 4096);
+	gem_write(fd, object.handle, 0, &bbe, sizeof(bbe));
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(&object);
+	execbuf.buffer_count = 1;
+	execbuf.flags = ring;
+	gem_execbuf(fd, &execbuf);
+	gem_sync(fd, object.handle);
+
+	intel_detect_and_clear_missed_interrupts(fd);
+	start = gettime();
+	cycles = 0;
+	do {
+		do {
+			gem_execbuf(fd, &execbuf);
+			gem_quiescent_gpu(fd);
+		} while (++cycles & 1023);
+	} while ((elapsed = gettime() - start) < timeout);
+	igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
+
+	igt_info("Completed %ld cycles: %.3f us\n",
+		 cycles, elapsed*1e6/cycles);
+
+	gem_close(fd, object.handle);
+}
+
 static void
 store_ring(int fd, unsigned ring, int num_children, int timeout)
 {
@@ -802,6 +841,8 @@ igt_main
 	for (e = intel_execution_engines; e->name; e++) {
 		igt_subtest_f("%s", e->name)
 			sync_ring(fd, e->exec_id | e->flags, 1, 150);
+		igt_subtest_f("idle-%s", e->name)
+			idle_ring(fd, e->exec_id | e->flags, 150);
 		igt_subtest_f("store-%s", e->name)
 			store_ring(fd, e->exec_id | e->flags, 1, 150);
 		igt_subtest_f("many-%s", e->name)
-- 
2.16.1

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

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

* [PATCH igt 2/2] lib: Cache the debugfs mountpoint
  2018-02-19 22:18 [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests Chris Wilson
@ 2018-02-19 22:18 ` Chris Wilson
  2018-02-20  8:52   ` Joonas Lahtinen
  2018-02-19 23:01 ` ✓ Fi.CI.BAT: success for series starting with [1/2] igt/gem_sync: Exercise and measure idle requests Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2018-02-19 22:18 UTC (permalink / raw)
  To: intel-gfx

When using igt_debugfs_*() inside a tight loop, the overhead of calling
xstat64 (from is_mountpoint()) creeps up in the profiles. Eliminate it
by caching the resultant path for finding/mounting debugfs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_debugfs.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 4a119985..09d42ea0 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -110,6 +110,20 @@ static bool is_mountpoint(const char *path)
 	return dev != st.st_dev;
 }
 
+static const char *__igt_debugfs_mount(void)
+{
+	if (is_mountpoint("/sys/kernel/debug"))
+		return "/sys/kernel/debug";
+
+	if (is_mountpoint("/debug"))
+		return "/debug";
+
+	if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
+		return NULL;
+
+	return "/sys/kernel/debug";
+}
+
 /**
  * igt_debugfs_mount:
  *
@@ -121,16 +135,12 @@ static bool is_mountpoint(const char *path)
  */
 const char *igt_debugfs_mount(void)
 {
-	if (is_mountpoint("/sys/kernel/debug"))
-		return "/sys/kernel/debug";
+	static const char *path;
 
-	if (is_mountpoint("/debug"))
-		return "/debug";
+	if (!path)
+		path = __igt_debugfs_mount();
 
-	if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
-		return NULL;
-
-	return "/sys/kernel/debug";
+	return path;
 }
 
 /**
-- 
2.16.1

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

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

* ✓ Fi.CI.BAT: success for series starting with [1/2] igt/gem_sync: Exercise and measure idle requests
  2018-02-19 22:18 [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests Chris Wilson
  2018-02-19 22:18 ` [PATCH igt 2/2] lib: Cache the debugfs mountpoint Chris Wilson
@ 2018-02-19 23:01 ` Patchwork
  2018-02-20  2:10 ` ✗ Fi.CI.IGT: warning " Patchwork
  2018-02-20  8:51 ` [PATCH igt 1/2] " Joonas Lahtinen
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-02-19 23:01 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] igt/gem_sync: Exercise and measure idle requests
URL   : https://patchwork.freedesktop.org/series/38550/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
6fc91dbb67eea6824100905a4ab1fb38f186dba0 perf_pmu: Fix some compile warnings with old compilers / 32-bit builds

with latest DRM-Tip kernel build CI_DRM_3802
2ca2a369fc68 drm-tip: 2018y-02m-19d-20h-39m-49s UTC integration manifest

Testlist changes:
+igt@gem_sync@idle-blt
+igt@gem_sync@idle-bsd
+igt@gem_sync@idle-bsd1
+igt@gem_sync@idle-bsd2
+igt@gem_sync@idle-default
+igt@gem_sync@idle-render
+igt@gem_sync@idle-vebox

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                pass       -> INCOMPLETE (fi-hsw-4770) fdo#103375

fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:420s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:431s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:378s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:495s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:289s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:483s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:491s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:472s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:459s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:571s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:576s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:415s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:282s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:513s
fi-hsw-4770      total:246  pass:222  dwarn:0   dfail:0   fail:0   skip:23 
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:413s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:464s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:412s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:458s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:496s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:457s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:503s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:598s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:437s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:511s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:529s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:493s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:481s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:417s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:526s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:402s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_956/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: warning for series starting with [1/2] igt/gem_sync: Exercise and measure idle requests
  2018-02-19 22:18 [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests Chris Wilson
  2018-02-19 22:18 ` [PATCH igt 2/2] lib: Cache the debugfs mountpoint Chris Wilson
  2018-02-19 23:01 ` ✓ Fi.CI.BAT: success for series starting with [1/2] igt/gem_sync: Exercise and measure idle requests Patchwork
@ 2018-02-20  2:10 ` Patchwork
  2018-02-20  8:51 ` [PATCH igt 1/2] " Joonas Lahtinen
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-02-20  2:10 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] igt/gem_sync: Exercise and measure idle requests
URL   : https://patchwork.freedesktop.org/series/38550/
State : warning

== Summary ==

Test perf:
        Subgroup buffer-fill:
                fail       -> PASS       (shard-apl) fdo#103755
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test gem_eio:
        Subgroup in-flight-contexts:
                pass       -> DMESG-WARN (shard-snb) fdo#104058
        Subgroup in-flight-external:
                pass       -> FAIL       (shard-hsw) fdo#104676
Test kms_flip:
        Subgroup plain-flip-fb-recreate:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test kms_rotation_crc:
        Subgroup primary-rotation-180:
                pass       -> FAIL       (shard-snb) fdo#103925
Test drv_suspend:
        Subgroup forcewake:
                pass       -> SKIP       (shard-snb)

fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925

shard-apl        total:3427 pass:1792 dwarn:1   dfail:0   fail:12  skip:1621 time:12367s
shard-hsw        total:3434 pass:1760 dwarn:1   dfail:0   fail:4   skip:1668 time:11893s
shard-snb        total:3434 pass:1349 dwarn:2   dfail:0   fail:3   skip:2080 time:6626s
Blacklisted hosts:
shard-kbl        total:3434 pass:1920 dwarn:7   dfail:0   fail:14  skip:1493 time:9749s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_956/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests
  2018-02-19 22:18 [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests Chris Wilson
                   ` (2 preceding siblings ...)
  2018-02-20  2:10 ` ✗ Fi.CI.IGT: warning " Patchwork
@ 2018-02-20  8:51 ` Joonas Lahtinen
  3 siblings, 0 replies; 7+ messages in thread
From: Joonas Lahtinen @ 2018-02-20  8:51 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Quoting Chris Wilson (2018-02-20 00:18:06)
> Don't just wait for the batch to be completed, wait for the system to
> idle! Then wake it up and do it again.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

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

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

* Re: [PATCH igt 2/2] lib: Cache the debugfs mountpoint
  2018-02-19 22:18 ` [PATCH igt 2/2] lib: Cache the debugfs mountpoint Chris Wilson
@ 2018-02-20  8:52   ` Joonas Lahtinen
  0 siblings, 0 replies; 7+ messages in thread
From: Joonas Lahtinen @ 2018-02-20  8:52 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Quoting Chris Wilson (2018-02-20 00:18:07)
> When using igt_debugfs_*() inside a tight loop, the overhead of calling
> xstat64 (from is_mountpoint()) creeps up in the profiles. Eliminate it
> by caching the resultant path for finding/mounting debugfs.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

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

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

* [PATCH igt 2/2] lib: Cache the debugfs mountpoint
  2018-02-19 22:18 Chris Wilson
@ 2018-02-19 22:18 ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-02-19 22:18 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

When using igt_debugfs_*() inside a tight loop, the overhead of calling
xstat64 (from is_mountpoint()) creeps up in the profiles. Eliminate it
by caching the resultant path for finding/mounting debugfs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_debugfs.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 4a119985..09d42ea0 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -110,6 +110,20 @@ static bool is_mountpoint(const char *path)
 	return dev != st.st_dev;
 }
 
+static const char *__igt_debugfs_mount(void)
+{
+	if (is_mountpoint("/sys/kernel/debug"))
+		return "/sys/kernel/debug";
+
+	if (is_mountpoint("/debug"))
+		return "/debug";
+
+	if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
+		return NULL;
+
+	return "/sys/kernel/debug";
+}
+
 /**
  * igt_debugfs_mount:
  *
@@ -121,16 +135,12 @@ static bool is_mountpoint(const char *path)
  */
 const char *igt_debugfs_mount(void)
 {
-	if (is_mountpoint("/sys/kernel/debug"))
-		return "/sys/kernel/debug";
+	static const char *path;
 
-	if (is_mountpoint("/debug"))
-		return "/debug";
+	if (!path)
+		path = __igt_debugfs_mount();
 
-	if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
-		return NULL;
-
-	return "/sys/kernel/debug";
+	return path;
 }
 
 /**
-- 
2.16.1

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

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

end of thread, other threads:[~2018-02-20  8:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 22:18 [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests Chris Wilson
2018-02-19 22:18 ` [PATCH igt 2/2] lib: Cache the debugfs mountpoint Chris Wilson
2018-02-20  8:52   ` Joonas Lahtinen
2018-02-19 23:01 ` ✓ Fi.CI.BAT: success for series starting with [1/2] igt/gem_sync: Exercise and measure idle requests Patchwork
2018-02-20  2:10 ` ✗ Fi.CI.IGT: warning " Patchwork
2018-02-20  8:51 ` [PATCH igt 1/2] " Joonas Lahtinen
2018-02-19 22:18 Chris Wilson
2018-02-19 22:18 ` [PATCH igt 2/2] lib: Cache the debugfs mountpoint Chris Wilson

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.