* [PATCH igt] tests/gem_spin_batch: Add multiengine test
@ 2017-04-13 10:02 Mika Kuoppala
2017-04-13 12:41 ` Chris Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Mika Kuoppala @ 2017-04-13 10:02 UTC (permalink / raw)
To: intel-gfx
Parallel spin on all engines.
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
tests/gem_spin_batch.c | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/tests/gem_spin_batch.c b/tests/gem_spin_batch.c
index baf796a..a22da32 100644
--- a/tests/gem_spin_batch.c
+++ b/tests/gem_spin_batch.c
@@ -32,7 +32,7 @@
"'%s' != '%s' (%lld not within %d%% tolerance of %lld)\n",\
#x, #ref, (long long)x, tolerance, (long long)ref)
-static void basic(int fd, unsigned int engine, unsigned int timeout_sec)
+static void spin(int fd, unsigned int engine, unsigned int timeout_sec)
{
const uint64_t timeout_100ms = 100000000LL;
unsigned long loops = 0;
@@ -63,6 +63,30 @@ static void basic(int fd, unsigned int engine, unsigned int timeout_sec)
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
}
+static void spin_exit_handler(int sig)
+{
+ igt_fixture {
+ igt_terminate_spin_batches();
+ }
+}
+
+static void spin_on_all_engines(int fd, unsigned int timeout_sec)
+{
+ unsigned engine;
+
+ for_each_engine(fd, engine) {
+ if (engine == 0)
+ continue;
+
+ igt_fork(child, 1) {
+ igt_install_exit_handler(spin_exit_handler);
+ spin(fd, engine, timeout_sec);
+ }
+ }
+
+ igt_waitchildren();
+}
+
igt_main
{
const struct intel_execution_engine *e;
@@ -82,9 +106,12 @@ igt_main
continue;
igt_subtest_f("basic-%s", e->name)
- basic(fd, e->exec_id, 3);
+ spin(fd, e->exec_id, 3);
}
+ igt_subtest("multiengine")
+ spin_on_all_engines(fd, 3);
+
igt_fixture {
igt_stop_hang_detector();
close(fd);
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH igt] tests/gem_spin_batch: Add multiengine test
2017-04-13 10:02 [PATCH igt] tests/gem_spin_batch: Add multiengine test Mika Kuoppala
@ 2017-04-13 12:41 ` Chris Wilson
2017-04-19 12:41 ` Mika Kuoppala
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2017-04-13 12:41 UTC (permalink / raw)
To: Mika Kuoppala; +Cc: intel-gfx
On Thu, Apr 13, 2017 at 01:02:37PM +0300, Mika Kuoppala wrote:
> Parallel spin on all engines.
>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> tests/gem_spin_batch.c | 31 +++++++++++++++++++++++++++++--
> 1 file changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/tests/gem_spin_batch.c b/tests/gem_spin_batch.c
> index baf796a..a22da32 100644
> --- a/tests/gem_spin_batch.c
> +++ b/tests/gem_spin_batch.c
> @@ -32,7 +32,7 @@
> "'%s' != '%s' (%lld not within %d%% tolerance of %lld)\n",\
> #x, #ref, (long long)x, tolerance, (long long)ref)
>
> -static void basic(int fd, unsigned int engine, unsigned int timeout_sec)
> +static void spin(int fd, unsigned int engine, unsigned int timeout_sec)
> {
> const uint64_t timeout_100ms = 100000000LL;
> unsigned long loops = 0;
> @@ -63,6 +63,30 @@ static void basic(int fd, unsigned int engine, unsigned int timeout_sec)
> igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> }
>
> +static void spin_exit_handler(int sig)
> +{
> + igt_fixture {
Should not be required?
> + igt_terminate_spin_batches();
> + }
> +}
> +
> +static void spin_on_all_engines(int fd, unsigned int timeout_sec)
> +{
> + unsigned engine;
> +
> + for_each_engine(fd, engine) {
> + if (engine == 0)
> + continue;
> +
> + igt_fork(child, 1) {
> + igt_install_exit_handler(spin_exit_handler);
Ok. The existing igt_terminate_spin_batches() is tied into the exit
handler of the parent process (from quiescent_gpu_at_exit).
> + spin(fd, engine, timeout_sec);
> + }
> + }
> +
> + igt_waitchildren();
> +}
> +
> igt_main
> {
> const struct intel_execution_engine *e;
> @@ -82,9 +106,12 @@ igt_main
> continue;
>
> igt_subtest_f("basic-%s", e->name)
> - basic(fd, e->exec_id, 3);
> + spin(fd, e->exec_id, 3);
> }
>
> + igt_subtest("multiengine")
I would call this spin-each, to try and differentiate this
spin on each engine independently from a second variant that shared a
single batch between all engines (spin-all).
That make take some tweaks to igt_spin_batch (hmm, actually should not be
that difficult...) and might be worth doing just in case there's a
diffference in TLB behaviour or whatnot.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH igt] tests/gem_spin_batch: Add multiengine test
2017-04-13 12:41 ` Chris Wilson
@ 2017-04-19 12:41 ` Mika Kuoppala
0 siblings, 0 replies; 3+ messages in thread
From: Mika Kuoppala @ 2017-04-19 12:41 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
Chris Wilson <chris@chris-wilson.co.uk> writes:
> On Thu, Apr 13, 2017 at 01:02:37PM +0300, Mika Kuoppala wrote:
>> Parallel spin on all engines.
>>
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
>> ---
>> tests/gem_spin_batch.c | 31 +++++++++++++++++++++++++++++--
>> 1 file changed, 29 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/gem_spin_batch.c b/tests/gem_spin_batch.c
>> index baf796a..a22da32 100644
>> --- a/tests/gem_spin_batch.c
>> +++ b/tests/gem_spin_batch.c
>> @@ -32,7 +32,7 @@
>> "'%s' != '%s' (%lld not within %d%% tolerance of %lld)\n",\
>> #x, #ref, (long long)x, tolerance, (long long)ref)
>>
>> -static void basic(int fd, unsigned int engine, unsigned int timeout_sec)
>> +static void spin(int fd, unsigned int engine, unsigned int timeout_sec)
>> {
>> const uint64_t timeout_100ms = 100000000LL;
>> unsigned long loops = 0;
>> @@ -63,6 +63,30 @@ static void basic(int fd, unsigned int engine, unsigned int timeout_sec)
>> igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
>> }
>>
>> +static void spin_exit_handler(int sig)
>> +{
>> + igt_fixture {
>
> Should not be required?
>
>> + igt_terminate_spin_batches();
>> + }
>> +}
>> +
>> +static void spin_on_all_engines(int fd, unsigned int timeout_sec)
>> +{
>> + unsigned engine;
>> +
>> + for_each_engine(fd, engine) {
>> + if (engine == 0)
>> + continue;
>> +
>> + igt_fork(child, 1) {
>> + igt_install_exit_handler(spin_exit_handler);
>
> Ok. The existing igt_terminate_spin_batches() is tied into the exit
> handler of the parent process (from quiescent_gpu_at_exit).
>
>> + spin(fd, engine, timeout_sec);
>> + }
>> + }
>> +
>> + igt_waitchildren();
>> +}
>> +
>> igt_main
>> {
>> const struct intel_execution_engine *e;
>> @@ -82,9 +106,12 @@ igt_main
>> continue;
>>
>> igt_subtest_f("basic-%s", e->name)
>> - basic(fd, e->exec_id, 3);
>> + spin(fd, e->exec_id, 3);
>> }
>>
>> + igt_subtest("multiengine")
>
> I would call this spin-each, to try and differentiate this
> spin on each engine independently from a second variant that shared a
> single batch between all engines (spin-all).
>
> That make take some tweaks to igt_spin_batch (hmm, actually should not be
> that difficult...) and might be worth doing just in case there's a
> diffference in TLB behaviour or whatnot.
>
Renamed the test and removed the fixture.
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Thanks. Pushed.
-Mika
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-19 12:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13 10:02 [PATCH igt] tests/gem_spin_batch: Add multiengine test Mika Kuoppala
2017-04-13 12:41 ` Chris Wilson
2017-04-19 12:41 ` Mika Kuoppala
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.