diff mbox series

[i-g-t] i915/perf_pmu: Check for hangs allowed

Message ID 20190128101849.21355-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [i-g-t] i915/perf_pmu: Check for hangs allowed | expand

Commit Message

Chris Wilson Jan. 28, 2019, 10:18 a.m. UTC
Check we can reset the GPU before running the reset test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
Different meaning of flags, it's not the ring id!
---
 tests/perf_pmu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Tvrtko Ursulin Jan. 28, 2019, 11 a.m. UTC | #1
On 28/01/2019 10:18, Chris Wilson wrote:
> Check we can reset the GPU before running the reset test.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> Different meaning of flags, it's not the ring id!
> ---
>   tests/perf_pmu.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index 21292bf3a..c9881e59f 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -1812,8 +1812,13 @@ igt_main
>   					accuracy(fd, e, pct[i], 10);
>   			}
>   
> -			igt_subtest_f("busy-hang-%s", e->name)
> +			igt_subtest_f("busy-hang-%s", e->name) {
> +				igt_hang_t hang = igt_allow_hang(fd, 0, 0);
> +
>   				single(fd, e, TEST_BUSY | FLAG_HANG);
> +
> +				igt_disallow_hang(fd, hang);
> +			}
>   		}
>   
>   		/**
> 

So all IGTs which trigger hangs/resets should call this?

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
Chris Wilson Jan. 28, 2019, 11:36 a.m. UTC | #2
Quoting Tvrtko Ursulin (2019-01-28 11:00:43)
> 
> On 28/01/2019 10:18, Chris Wilson wrote:
> > Check we can reset the GPU before running the reset test.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> > Different meaning of flags, it's not the ring id!
> > ---
> >   tests/perf_pmu.c | 7 ++++++-
> >   1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> > index 21292bf3a..c9881e59f 100644
> > --- a/tests/perf_pmu.c
> > +++ b/tests/perf_pmu.c
> > @@ -1812,8 +1812,13 @@ igt_main
> >                                       accuracy(fd, e, pct[i], 10);
> >                       }
> >   
> > -                     igt_subtest_f("busy-hang-%s", e->name)
> > +                     igt_subtest_f("busy-hang-%s", e->name) {
> > +                             igt_hang_t hang = igt_allow_hang(fd, 0, 0);
> > +
> >                               single(fd, e, TEST_BUSY | FLAG_HANG);
> > +
> > +                             igt_disallow_hang(fd, hang);
> > +                     }
> >               }
> >   
> >               /**
> > 
> 
> So all IGTs which trigger hangs/resets should call this?

Yeah, aside from checking we have gpu-reset, it is meant to prep the
context to expect a hang. It just happens to work fine until we hit a
corner case (such as gen2, guc currently, or too many resets).
-Chris
diff mbox series

Patch

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 21292bf3a..c9881e59f 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1812,8 +1812,13 @@  igt_main
 					accuracy(fd, e, pct[i], 10);
 			}
 
-			igt_subtest_f("busy-hang-%s", e->name)
+			igt_subtest_f("busy-hang-%s", e->name) {
+				igt_hang_t hang = igt_allow_hang(fd, 0, 0);
+
 				single(fd, e, TEST_BUSY | FLAG_HANG);
+
+				igt_disallow_hang(fd, hang);
+			}
 		}
 
 		/**