All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] lib/dummyload: Avoid assertions in lowlevel spin constructor
@ 2018-02-22  8:50 Chris Wilson
  2018-02-22 12:21 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2018-02-22  8:50 UTC (permalink / raw)
  To: intel-gfx

__igt_spin_batch_new() may be used inside a background helper which is
competing against the GPU being reset. As such, we cannot even assert
that the spin->handle is busy immediately after submission as it may
have already been reset by another client writing to i915_wedged.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_dummyload.c | 17 ++++++++++++++---
 tests/pm_rps.c      |  4 +++-
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 27eb402b..8ecd1dc8 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -25,6 +25,7 @@
 #include <time.h>
 #include <signal.h>
 #include <pthread.h>
+#include <sys/poll.h>
 
 #include <i915_drm.h>
 
@@ -205,7 +206,6 @@ ___igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep,
 
 	spin->out_fence = emit_recursive_batch(spin, fd, ctx, engine, dep,
 					       out_fence);
-	igt_assert(gem_bo_busy(fd, spin->handle));
 
 	pthread_mutex_lock(&list_lock);
 	igt_list_add(&spin->link, &spin_list);
@@ -238,9 +238,14 @@ __igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep)
 igt_spin_t *
 igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep)
 {
+	igt_spin_t *spin;
+
 	igt_require_gem(fd);
 
-	return __igt_spin_batch_new(fd, ctx, engine, dep);
+	spin = __igt_spin_batch_new(fd, ctx, engine, dep);
+	igt_assert(gem_bo_busy(fd, spin->handle));
+
+	return spin;
 }
 
 igt_spin_t *
@@ -267,10 +272,16 @@ __igt_spin_batch_new_fence(int fd, uint32_t ctx, unsigned engine)
 igt_spin_t *
 igt_spin_batch_new_fence(int fd, uint32_t ctx, unsigned engine)
 {
+	igt_spin_t *spin;
+
 	igt_require_gem(fd);
 	igt_require(gem_has_exec_fence(fd));
 
-	return __igt_spin_batch_new_fence(fd, ctx, engine);
+	spin = __igt_spin_batch_new_fence(fd, ctx, engine);
+	igt_assert(gem_bo_busy(fd, spin->handle));
+	igt_assert(poll(&(struct pollfd){spin->out_fence, POLLIN}, 1, 0) == 0);
+
+	return spin;
 }
 
 static void notify(union sigval arg)
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index f71976ed..006d084b 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -221,6 +221,8 @@ static void load_helper_run(enum load load)
 		return;
 	}
 
+	igt_require_gem(drm_fd);
+
 	lh.exit = false;
 	lh.load = load;
 
@@ -233,7 +235,7 @@ static void load_helper_run(enum load load)
 
 		igt_debug("Applying %s load...\n", lh.load ? "high" : "low");
 
-		spin[0] = igt_spin_batch_new(drm_fd, 0, 0, 0);
+		spin[0] = __igt_spin_batch_new(drm_fd, 0, 0, 0);
 		if (lh.load == HIGH)
 			spin[1] = __igt_spin_batch_new(drm_fd, 0, 0, 0);
 		while (!lh.exit) {
-- 
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] 5+ messages in thread

* ✓ Fi.CI.BAT: success for lib/dummyload: Avoid assertions in lowlevel spin constructor
  2018-02-22  8:50 [PATCH igt] lib/dummyload: Avoid assertions in lowlevel spin constructor Chris Wilson
@ 2018-02-22 12:21 ` Patchwork
  2018-02-22 16:13 ` ✗ Fi.CI.IGT: failure " Patchwork
  2018-02-22 21:24 ` [PATCH igt] " Antonio Argenziano
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-02-22 12:21 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: lib/dummyload: Avoid assertions in lowlevel spin constructor
URL   : https://patchwork.freedesktop.org/series/38753/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
f09f5c6a197424cef702222d6864416ac1f4fd23 igt/perf_pmu: Fix 64b printf-isms

with latest DRM-Tip kernel build CI_DRM_3821
56c6f2eb05bf drm-tip: 2018y-02m-22d-09h-36m-00s UTC integration manifest

No testlist changes.

Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test prime_vgem:
        Subgroup basic-fence-flip:
                pass       -> FAIL       (fi-ilk-650) fdo#104008

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

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:417s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:425s
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:485s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:286s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:476s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:485s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:467s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:456s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:562s
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:283s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:508s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:385s
fi-ilk-650       total:288  pass:227  dwarn:0   dfail:0   fail:1   skip:60  time:410s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:453s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:414s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:451s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:491s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:494s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:592s
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:505s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:521s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:489s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:478s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:409s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:433s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:394s
Blacklisted hosts:
fi-cfl-8700k     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:392s

== Logs ==

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

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

* ✗ Fi.CI.IGT: failure for lib/dummyload: Avoid assertions in lowlevel spin constructor
  2018-02-22  8:50 [PATCH igt] lib/dummyload: Avoid assertions in lowlevel spin constructor Chris Wilson
  2018-02-22 12:21 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-02-22 16:13 ` Patchwork
  2018-02-22 21:24 ` [PATCH igt] " Antonio Argenziano
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-02-22 16:13 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: lib/dummyload: Avoid assertions in lowlevel spin constructor
URL   : https://patchwork.freedesktop.org/series/38753/
State : failure

== Summary ==

Test kms_flip:
        Subgroup modeset-vs-vblank-race-interruptible:
                fail       -> PASS       (shard-hsw) fdo#103060
        Subgroup 2x-plain-flip-fb-recreate:
                fail       -> PASS       (shard-hsw) fdo#100368 +1
Test perf:
        Subgroup polling:
                pass       -> FAIL       (shard-hsw) fdo#102252
        Subgroup oa-exponents:
                fail       -> PASS       (shard-apl) fdo#102254
        Subgroup enable-disable:
                pass       -> FAIL       (shard-apl) fdo#103715
Test kms_vblank:
        Subgroup pipe-c-accuracy-idle:
                fail       -> PASS       (shard-apl) fdo#102583 +1
Test gem_eio:
        Subgroup in-flight-contexts:
                pass       -> INCOMPLETE (shard-apl) fdo#104945 +1
        Subgroup in-flight-suspend:
                skip       -> PASS       (shard-snb) fdo#103375
        Subgroup in-flight-external:
                pass       -> INCOMPLETE (shard-apl)
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-apl) fdo#99912
Test kms_rotation_crc:
        Subgroup primary-rotation-180:
                fail       -> PASS       (shard-snb) fdo#103925
Test pm_rps:
        Subgroup reset:
                incomplete -> PASS       (shard-apl) fdo#102250
Test kms_cursor_crc:
        Subgroup cursor-128x128-suspend:
                skip       -> PASS       (shard-snb) fdo#103880

fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#102583 https://bugs.freedesktop.org/show_bug.cgi?id=102583
fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#102250 https://bugs.freedesktop.org/show_bug.cgi?id=102250
fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880

shard-apl        total:3391 pass:1772 dwarn:1   dfail:0   fail:14  skip:1601 time:11681s
shard-hsw        total:3465 pass:1765 dwarn:1   dfail:0   fail:5   skip:1693 time:11538s
shard-snb        total:3465 pass:1358 dwarn:1   dfail:0   fail:2   skip:2104 time:6669s
Blacklisted hosts:
shard-kbl        total:3403 pass:1922 dwarn:9   dfail:1   fail:14  skip:1456 time:9223s

== Logs ==

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

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

* Re: [PATCH igt] lib/dummyload: Avoid assertions in lowlevel spin constructor
  2018-02-22  8:50 [PATCH igt] lib/dummyload: Avoid assertions in lowlevel spin constructor Chris Wilson
  2018-02-22 12:21 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-02-22 16:13 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-02-22 21:24 ` Antonio Argenziano
  2018-02-22 21:27   ` Chris Wilson
  2 siblings, 1 reply; 5+ messages in thread
From: Antonio Argenziano @ 2018-02-22 21:24 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx



On 22/02/18 00:50, Chris Wilson wrote:
> __igt_spin_batch_new() may be used inside a background helper which is
> competing against the GPU being reset. As such, we cannot even assert
> that the spin->handle is busy immediately after submission as it may
> have already been reset by another client writing to i915_wedged.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   lib/igt_dummyload.c | 17 ++++++++++++++---
>   tests/pm_rps.c      |  4 +++-
>   2 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 27eb402b..8ecd1dc8 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -25,6 +25,7 @@
>   #include <time.h>
>   #include <signal.h>
>   #include <pthread.h>
> +#include <sys/poll.h>
>   
>   #include <i915_drm.h>
>   
> @@ -205,7 +206,6 @@ ___igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep,
>   
>   	spin->out_fence = emit_recursive_batch(spin, fd, ctx, engine, dep,
>   					       out_fence);
> -	igt_assert(gem_bo_busy(fd, spin->handle));
>   
>   	pthread_mutex_lock(&list_lock);
>   	igt_list_add(&spin->link, &spin_list);
> @@ -238,9 +238,14 @@ __igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep)
>   igt_spin_t *
>   igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep)
>   {
> +	igt_spin_t *spin;
> +
>   	igt_require_gem(fd);
>   
> -	return __igt_spin_batch_new(fd, ctx, engine, dep);
> +	spin = __igt_spin_batch_new(fd, ctx, engine, dep);
> +	igt_assert(gem_bo_busy(fd, spin->handle));

Should all uses of the low level constructors be changed to this high 
level one if the test doesn't have the race with i915_wedged?

Thanks,
Antonio

> +
> +	return spin;
>   }
>   
>   igt_spin_t *
> @@ -267,10 +272,16 @@ __igt_spin_batch_new_fence(int fd, uint32_t ctx, unsigned engine)
>   igt_spin_t *
>   igt_spin_batch_new_fence(int fd, uint32_t ctx, unsigned engine)
>   {
> +	igt_spin_t *spin;
> +
>   	igt_require_gem(fd);
>   	igt_require(gem_has_exec_fence(fd));
>   
> -	return __igt_spin_batch_new_fence(fd, ctx, engine);
> +	spin = __igt_spin_batch_new_fence(fd, ctx, engine);
> +	igt_assert(gem_bo_busy(fd, spin->handle));
> +	igt_assert(poll(&(struct pollfd){spin->out_fence, POLLIN}, 1, 0) == 0);
> +
> +	return spin;
>   }
>   
>   static void notify(union sigval arg)
> diff --git a/tests/pm_rps.c b/tests/pm_rps.c
> index f71976ed..006d084b 100644
> --- a/tests/pm_rps.c
> +++ b/tests/pm_rps.c
> @@ -221,6 +221,8 @@ static void load_helper_run(enum load load)
>   		return;
>   	}
>   
> +	igt_require_gem(drm_fd);
> +
>   	lh.exit = false;
>   	lh.load = load;
>   
> @@ -233,7 +235,7 @@ static void load_helper_run(enum load load)
>   
>   		igt_debug("Applying %s load...\n", lh.load ? "high" : "low");
>   
> -		spin[0] = igt_spin_batch_new(drm_fd, 0, 0, 0);
> +		spin[0] = __igt_spin_batch_new(drm_fd, 0, 0, 0);
>   		if (lh.load == HIGH)
>   			spin[1] = __igt_spin_batch_new(drm_fd, 0, 0, 0);
>   		while (!lh.exit) {
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt] lib/dummyload: Avoid assertions in lowlevel spin constructor
  2018-02-22 21:24 ` [PATCH igt] " Antonio Argenziano
@ 2018-02-22 21:27   ` Chris Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2018-02-22 21:27 UTC (permalink / raw)
  To: Antonio Argenziano, intel-gfx

Quoting Antonio Argenziano (2018-02-22 21:24:31)
> 
> 
> On 22/02/18 00:50, Chris Wilson wrote:
> > __igt_spin_batch_new() may be used inside a background helper which is
> > competing against the GPU being reset. As such, we cannot even assert
> > that the spin->handle is busy immediately after submission as it may
> > have already been reset by another client writing to i915_wedged.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >   lib/igt_dummyload.c | 17 ++++++++++++++---
> >   tests/pm_rps.c      |  4 +++-
> >   2 files changed, 17 insertions(+), 4 deletions(-)
> > 
> > diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> > index 27eb402b..8ecd1dc8 100644
> > --- a/lib/igt_dummyload.c
> > +++ b/lib/igt_dummyload.c
> > @@ -25,6 +25,7 @@
> >   #include <time.h>
> >   #include <signal.h>
> >   #include <pthread.h>
> > +#include <sys/poll.h>
> >   
> >   #include <i915_drm.h>
> >   
> > @@ -205,7 +206,6 @@ ___igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep,
> >   
> >       spin->out_fence = emit_recursive_batch(spin, fd, ctx, engine, dep,
> >                                              out_fence);
> > -     igt_assert(gem_bo_busy(fd, spin->handle));
> >   
> >       pthread_mutex_lock(&list_lock);
> >       igt_list_add(&spin->link, &spin_list);
> > @@ -238,9 +238,14 @@ __igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep)
> >   igt_spin_t *
> >   igt_spin_batch_new(int fd, uint32_t ctx, unsigned engine, uint32_t dep)
> >   {
> > +     igt_spin_t *spin;
> > +
> >       igt_require_gem(fd);
> >   
> > -     return __igt_spin_batch_new(fd, ctx, engine, dep);
> > +     spin = __igt_spin_batch_new(fd, ctx, engine, dep);
> > +     igt_assert(gem_bo_busy(fd, spin->handle));
> 
> Should all uses of the low level constructors be changed to this high 
> level one if the test doesn't have the race with i915_wedged?

No. There is the waiting side-effect as well which is more often the
problem.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-02-22 21:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22  8:50 [PATCH igt] lib/dummyload: Avoid assertions in lowlevel spin constructor Chris Wilson
2018-02-22 12:21 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-02-22 16:13 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-02-22 21:24 ` [PATCH igt] " Antonio Argenziano
2018-02-22 21:27   ` 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.