* [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests
@ 2018-02-19 22:18 ` Chris Wilson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-02-19 22:18 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
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] 6+ messages in thread
* [Intel-gfx] [PATCH igt 1/2] igt/gem_sync: Exercise and measure idle requests
@ 2018-02-19 22:18 ` Chris Wilson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-02-19 22:18 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
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] 6+ messages in thread
* [PATCH igt 2/2] lib: Cache the debugfs mountpoint
2018-02-19 22:18 ` [Intel-gfx] " Chris Wilson
@ 2018-02-19 22:18 ` Chris Wilson
-1 siblings, 0 replies; 6+ 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] 6+ messages in thread
* [igt-dev] [PATCH igt 2/2] lib: Cache the debugfs mountpoint
@ 2018-02-19 22:18 ` Chris Wilson
0 siblings, 0 replies; 6+ 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
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/2] igt/gem_sync: Exercise and measure idle requests
2018-02-19 22:18 ` [Intel-gfx] " Chris Wilson
(?)
(?)
@ 2018-02-19 23:18 ` Patchwork
-1 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-02-19 23:18 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev
== Series Details ==
Series: series starting with [1/2] igt/gem_sync: Exercise and measure idle requests
URL : https://patchwork.freedesktop.org/series/38551/
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
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:421s
fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:426s
fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:376s
fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:497s
fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:288s
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:473s
fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:463s
fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:572s
fi-cnl-y3 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:581s
fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:413s
fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:285s
fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:515s
fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:392s
fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:414s
fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:461s
fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:418s
fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:460s
fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:499s
fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:455s
fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:501s
fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:591s
fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:428s
fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:513s
fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:527s
fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:505s
fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:477s
fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:415s
fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:430s
fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:522s
fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:406s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_957/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* [igt-dev] ✗ Fi.CI.IGT: warning for series starting with [1/2] igt/gem_sync: Exercise and measure idle requests
2018-02-19 22:18 ` [Intel-gfx] " Chris Wilson
` (2 preceding siblings ...)
(?)
@ 2018-02-20 2:44 ` Patchwork
-1 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-02-20 2:44 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev
== Series Details ==
Series: series starting with [1/2] igt/gem_sync: Exercise and measure idle requests
URL : https://patchwork.freedesktop.org/series/38551/
State : warning
== Summary ==
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-primscrn-shrfb-msflip-blt:
pass -> SKIP (shard-snb) fdo#101623
Test kms_draw_crc:
Subgroup draw-method-rgb565-blt-untiled:
pass -> SKIP (shard-snb)
Test kms_mmap_write_crc:
pass -> SKIP (shard-snb)
Test perf:
Subgroup enable-disable:
pass -> FAIL (shard-apl) fdo#103715
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-hsw) fdo#99912
Test kms_rotation_crc:
Subgroup sprite-rotation-180:
pass -> FAIL (shard-snb) fdo#103925
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
shard-apl total:3385 pass:1772 dwarn:1 dfail:0 fail:15 skip:1596 time:12225s
shard-hsw total:3434 pass:1762 dwarn:1 dfail:0 fail:2 skip:1668 time:11669s
shard-snb total:3434 pass:1348 dwarn:1 dfail:0 fail:3 skip:2082 time:6642s
Blacklisted hosts:
shard-kbl total:3434 pass:1926 dwarn:1 dfail:0 fail:13 skip:1494 time:9741s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_957/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-02-20 2:44 UTC | newest]
Thread overview: 6+ 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 ` [Intel-gfx] " Chris Wilson
2018-02-19 22:18 ` [PATCH igt 2/2] lib: Cache the debugfs mountpoint Chris Wilson
2018-02-19 22:18 ` [igt-dev] " Chris Wilson
2018-02-19 23:18 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/2] igt/gem_sync: Exercise and measure idle requests Patchwork
2018-02-20 2:44 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
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.