* [PATCH i-g-t] lib: Cancel all outstanding requests at the end of a test
@ 2018-09-07 8:41 ` Chris Wilson
0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-07 8:41 UTC (permalink / raw)
To: igt-dev; +Cc: intel-gfx
Quite often on catastrophic failure the test leaves a long queue of
unterminated batches pending execution. Each runs until hangcheck fires
and skips onto the next, leaving us waiting for a very long time at test
exit.
On older kernels, this gracefully degrades into the existing mechanism.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
lib/drmtest.c | 25 +++++++++++++++++++------
lib/igt_debugfs.h | 12 ++++++++++++
2 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index bfa2e0f0a..fee9d33ad 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -302,22 +302,35 @@ static int __drm_open_driver_render(int chipset)
static int at_exit_drm_fd = -1;
static int at_exit_drm_render_fd = -1;
-static void quiescent_gpu_at_exit(int sig)
+static void __cancel_work_at_exit(int fd)
+{
+ igt_terminate_spin_batches(); /* for older kernels */
+
+ igt_drop_caches_set(fd,
+ /* cancel everything */
+ DROP_RESET_ACTIVE | DROP_RESET_SEQNO |
+ /* cleanup */
+ DROP_ACTIVE | DROP_RETIRE | DROP_IDLE | DROP_FREED);
+}
+
+static void cancel_work_at_exit(int sig)
{
if (at_exit_drm_fd < 0)
return;
- gem_quiescent_gpu(at_exit_drm_fd);
+ __cancel_work_at_exit(at_exit_drm_fd);
+
close(at_exit_drm_fd);
at_exit_drm_fd = -1;
}
-static void quiescent_gpu_at_exit_render(int sig)
+static void cancel_work_at_exit_render(int sig)
{
if (at_exit_drm_render_fd < 0)
return;
- gem_quiescent_gpu(at_exit_drm_render_fd);
+ __cancel_work_at_exit(at_exit_drm_render_fd);
+
close(at_exit_drm_render_fd);
at_exit_drm_render_fd = -1;
}
@@ -369,7 +382,7 @@ int drm_open_driver(int chipset)
gem_quiescent_gpu(fd);
at_exit_drm_fd = __drm_open_driver(chipset);
- igt_install_exit_handler(quiescent_gpu_at_exit);
+ igt_install_exit_handler(cancel_work_at_exit);
}
}
@@ -418,7 +431,7 @@ int drm_open_driver_render(int chipset)
at_exit_drm_render_fd = __drm_open_driver(chipset);
if(chipset & DRIVER_INTEL){
gem_quiescent_gpu(fd);
- igt_install_exit_handler(quiescent_gpu_at_exit_render);
+ igt_install_exit_handler(cancel_work_at_exit_render);
}
return fd;
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index ff8612dc6..9f81be0a2 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -190,6 +190,18 @@ void igt_require_hpd_storm_ctl(int fd);
* Flush the driver's idle_worker, releasing internal caches and wakerefs.
*/
#define DROP_IDLE 0x40
+/**
+ * DROP_RESET_ACTIVE:
+ *
+ * Cancel all outstanding requests by forcing a gpu reset
+ */
+#define DROP_RESET_ACTIVE 0x80
+/**
+ * DROP_RESET_SEQNO:
+ *
+ * Reset the global request seqno counter back to 0
+ */
+#define DROP_RESET_SEQNO 0x100
/**
* DROP_ALL:
*
--
2.19.0.rc2
_______________________________________________
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
* [igt-dev] [PATCH i-g-t] lib: Cancel all outstanding requests at the end of a test
@ 2018-09-07 8:41 ` Chris Wilson
0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-07 8:41 UTC (permalink / raw)
To: igt-dev; +Cc: intel-gfx
Quite often on catastrophic failure the test leaves a long queue of
unterminated batches pending execution. Each runs until hangcheck fires
and skips onto the next, leaving us waiting for a very long time at test
exit.
On older kernels, this gracefully degrades into the existing mechanism.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
lib/drmtest.c | 25 +++++++++++++++++++------
lib/igt_debugfs.h | 12 ++++++++++++
2 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index bfa2e0f0a..fee9d33ad 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -302,22 +302,35 @@ static int __drm_open_driver_render(int chipset)
static int at_exit_drm_fd = -1;
static int at_exit_drm_render_fd = -1;
-static void quiescent_gpu_at_exit(int sig)
+static void __cancel_work_at_exit(int fd)
+{
+ igt_terminate_spin_batches(); /* for older kernels */
+
+ igt_drop_caches_set(fd,
+ /* cancel everything */
+ DROP_RESET_ACTIVE | DROP_RESET_SEQNO |
+ /* cleanup */
+ DROP_ACTIVE | DROP_RETIRE | DROP_IDLE | DROP_FREED);
+}
+
+static void cancel_work_at_exit(int sig)
{
if (at_exit_drm_fd < 0)
return;
- gem_quiescent_gpu(at_exit_drm_fd);
+ __cancel_work_at_exit(at_exit_drm_fd);
+
close(at_exit_drm_fd);
at_exit_drm_fd = -1;
}
-static void quiescent_gpu_at_exit_render(int sig)
+static void cancel_work_at_exit_render(int sig)
{
if (at_exit_drm_render_fd < 0)
return;
- gem_quiescent_gpu(at_exit_drm_render_fd);
+ __cancel_work_at_exit(at_exit_drm_render_fd);
+
close(at_exit_drm_render_fd);
at_exit_drm_render_fd = -1;
}
@@ -369,7 +382,7 @@ int drm_open_driver(int chipset)
gem_quiescent_gpu(fd);
at_exit_drm_fd = __drm_open_driver(chipset);
- igt_install_exit_handler(quiescent_gpu_at_exit);
+ igt_install_exit_handler(cancel_work_at_exit);
}
}
@@ -418,7 +431,7 @@ int drm_open_driver_render(int chipset)
at_exit_drm_render_fd = __drm_open_driver(chipset);
if(chipset & DRIVER_INTEL){
gem_quiescent_gpu(fd);
- igt_install_exit_handler(quiescent_gpu_at_exit_render);
+ igt_install_exit_handler(cancel_work_at_exit_render);
}
return fd;
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index ff8612dc6..9f81be0a2 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -190,6 +190,18 @@ void igt_require_hpd_storm_ctl(int fd);
* Flush the driver's idle_worker, releasing internal caches and wakerefs.
*/
#define DROP_IDLE 0x40
+/**
+ * DROP_RESET_ACTIVE:
+ *
+ * Cancel all outstanding requests by forcing a gpu reset
+ */
+#define DROP_RESET_ACTIVE 0x80
+/**
+ * DROP_RESET_SEQNO:
+ *
+ * Reset the global request seqno counter back to 0
+ */
+#define DROP_RESET_SEQNO 0x100
/**
* DROP_ALL:
*
--
2.19.0.rc2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for lib: Cancel all outstanding requests at the end of a test
2018-09-07 8:41 ` [igt-dev] " Chris Wilson
(?)
@ 2018-09-07 9:39 ` Patchwork
-1 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-09-07 9:39 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev
== Series Details ==
Series: lib: Cancel all outstanding requests at the end of a test
URL : https://patchwork.freedesktop.org/series/49329/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4782 -> IGTPW_1808 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/49329/revisions/1/mbox/
== Known issues ==
Here are the changes found in IGTPW_1808 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_exec_suspend@basic-s4-devices:
fi-blb-e6850: PASS -> INCOMPLETE (fdo#107718)
igt@kms_frontbuffer_tracking@basic:
fi-byt-clapper: PASS -> FAIL (fdo#103167)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-bxt-dsi: PASS -> INCOMPLETE (fdo#103927)
igt@kms_psr@primary_page_flip:
fi-kbl-r: PASS -> FAIL (fdo#107336)
==== Possible fixes ====
igt@amdgpu/amd_cs_nop@sync-fork-gfx0:
fi-kbl-8809g: DMESG-WARN (fdo#107762) -> PASS
igt@kms_psr@primary_page_flip:
fi-kbl-7560u: FAIL (fdo#107336) -> PASS
==== Warnings ====
igt@amdgpu/amd_prime@amd-to-i915:
fi-kbl-8809g: DMESG-FAIL (fdo#107762) -> FAIL (fdo#107341)
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
fdo#107341 https://bugs.freedesktop.org/show_bug.cgi?id=107341
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
fdo#107762 https://bugs.freedesktop.org/show_bug.cgi?id=107762
== Participating hosts (52 -> 47) ==
Additional (1): fi-byt-j1900
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-hsw-peppy fi-byt-squawks fi-bsw-cyan fi-ctg-p8600
== Build changes ==
* IGT: IGT_4632 -> IGTPW_1808
CI_DRM_4782: 60edf94611d2374821fbe2a824cebcb425ce7b0d @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1808: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1808/
IGT_4632: 94b4e204473a7d9f49e536c8877a4a5636e0d1b2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1808/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib: Cancel all outstanding requests at the end of a test
2018-09-07 8:41 ` [igt-dev] " Chris Wilson
@ 2018-09-07 16:37 ` Antonio Argenziano
-1 siblings, 0 replies; 7+ messages in thread
From: Antonio Argenziano @ 2018-09-07 16:37 UTC (permalink / raw)
To: Chris Wilson, igt-dev; +Cc: intel-gfx
On 07/09/18 01:41, Chris Wilson wrote:
> Quite often on catastrophic failure the test leaves a long queue of
> unterminated batches pending execution. Each runs until hangcheck fires
> and skips onto the next, leaving us waiting for a very long time at test
> exit.
>
> On older kernels, this gracefully degrades into the existing mechanism.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
LGTM. Just, if I have to be really picky, the comment for
quiescent_gpu() says it is installed as an exit handler.
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> lib/drmtest.c | 25 +++++++++++++++++++------
> lib/igt_debugfs.h | 12 ++++++++++++
> 2 files changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index bfa2e0f0a..fee9d33ad 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -302,22 +302,35 @@ static int __drm_open_driver_render(int chipset)
> static int at_exit_drm_fd = -1;
> static int at_exit_drm_render_fd = -1;
>
> -static void quiescent_gpu_at_exit(int sig)
> +static void __cancel_work_at_exit(int fd)
> +{
> + igt_terminate_spin_batches(); /* for older kernels */
> +
> + igt_drop_caches_set(fd,
> + /* cancel everything */
> + DROP_RESET_ACTIVE | DROP_RESET_SEQNO |
> + /* cleanup */
> + DROP_ACTIVE | DROP_RETIRE | DROP_IDLE | DROP_FREED);
> +}
> +
> +static void cancel_work_at_exit(int sig)
> {
> if (at_exit_drm_fd < 0)
> return;
>
> - gem_quiescent_gpu(at_exit_drm_fd);
> + __cancel_work_at_exit(at_exit_drm_fd);
> +
> close(at_exit_drm_fd);
> at_exit_drm_fd = -1;
> }
>
> -static void quiescent_gpu_at_exit_render(int sig)
> +static void cancel_work_at_exit_render(int sig)
> {
> if (at_exit_drm_render_fd < 0)
> return;
>
> - gem_quiescent_gpu(at_exit_drm_render_fd);
> + __cancel_work_at_exit(at_exit_drm_render_fd);
> +
> close(at_exit_drm_render_fd);
> at_exit_drm_render_fd = -1;
> }
> @@ -369,7 +382,7 @@ int drm_open_driver(int chipset)
> gem_quiescent_gpu(fd);
>
> at_exit_drm_fd = __drm_open_driver(chipset);
> - igt_install_exit_handler(quiescent_gpu_at_exit);
> + igt_install_exit_handler(cancel_work_at_exit);
> }
> }
>
> @@ -418,7 +431,7 @@ int drm_open_driver_render(int chipset)
> at_exit_drm_render_fd = __drm_open_driver(chipset);
> if(chipset & DRIVER_INTEL){
> gem_quiescent_gpu(fd);
> - igt_install_exit_handler(quiescent_gpu_at_exit_render);
> + igt_install_exit_handler(cancel_work_at_exit_render);
> }
>
> return fd;
> diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
> index ff8612dc6..9f81be0a2 100644
> --- a/lib/igt_debugfs.h
> +++ b/lib/igt_debugfs.h
> @@ -190,6 +190,18 @@ void igt_require_hpd_storm_ctl(int fd);
> * Flush the driver's idle_worker, releasing internal caches and wakerefs.
> */
> #define DROP_IDLE 0x40
> +/**
> + * DROP_RESET_ACTIVE:
> + *
> + * Cancel all outstanding requests by forcing a gpu reset
> + */
> +#define DROP_RESET_ACTIVE 0x80
> +/**
> + * DROP_RESET_SEQNO:
> + *
> + * Reset the global request seqno counter back to 0
> + */
> +#define DROP_RESET_SEQNO 0x100
> /**
> * DROP_ALL:
> *
>
_______________________________________________
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: [igt-dev] [PATCH i-g-t] lib: Cancel all outstanding requests at the end of a test
@ 2018-09-07 16:37 ` Antonio Argenziano
0 siblings, 0 replies; 7+ messages in thread
From: Antonio Argenziano @ 2018-09-07 16:37 UTC (permalink / raw)
To: Chris Wilson, igt-dev; +Cc: intel-gfx
On 07/09/18 01:41, Chris Wilson wrote:
> Quite often on catastrophic failure the test leaves a long queue of
> unterminated batches pending execution. Each runs until hangcheck fires
> and skips onto the next, leaving us waiting for a very long time at test
> exit.
>
> On older kernels, this gracefully degrades into the existing mechanism.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
LGTM. Just, if I have to be really picky, the comment for
quiescent_gpu() says it is installed as an exit handler.
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> lib/drmtest.c | 25 +++++++++++++++++++------
> lib/igt_debugfs.h | 12 ++++++++++++
> 2 files changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index bfa2e0f0a..fee9d33ad 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -302,22 +302,35 @@ static int __drm_open_driver_render(int chipset)
> static int at_exit_drm_fd = -1;
> static int at_exit_drm_render_fd = -1;
>
> -static void quiescent_gpu_at_exit(int sig)
> +static void __cancel_work_at_exit(int fd)
> +{
> + igt_terminate_spin_batches(); /* for older kernels */
> +
> + igt_drop_caches_set(fd,
> + /* cancel everything */
> + DROP_RESET_ACTIVE | DROP_RESET_SEQNO |
> + /* cleanup */
> + DROP_ACTIVE | DROP_RETIRE | DROP_IDLE | DROP_FREED);
> +}
> +
> +static void cancel_work_at_exit(int sig)
> {
> if (at_exit_drm_fd < 0)
> return;
>
> - gem_quiescent_gpu(at_exit_drm_fd);
> + __cancel_work_at_exit(at_exit_drm_fd);
> +
> close(at_exit_drm_fd);
> at_exit_drm_fd = -1;
> }
>
> -static void quiescent_gpu_at_exit_render(int sig)
> +static void cancel_work_at_exit_render(int sig)
> {
> if (at_exit_drm_render_fd < 0)
> return;
>
> - gem_quiescent_gpu(at_exit_drm_render_fd);
> + __cancel_work_at_exit(at_exit_drm_render_fd);
> +
> close(at_exit_drm_render_fd);
> at_exit_drm_render_fd = -1;
> }
> @@ -369,7 +382,7 @@ int drm_open_driver(int chipset)
> gem_quiescent_gpu(fd);
>
> at_exit_drm_fd = __drm_open_driver(chipset);
> - igt_install_exit_handler(quiescent_gpu_at_exit);
> + igt_install_exit_handler(cancel_work_at_exit);
> }
> }
>
> @@ -418,7 +431,7 @@ int drm_open_driver_render(int chipset)
> at_exit_drm_render_fd = __drm_open_driver(chipset);
> if(chipset & DRIVER_INTEL){
> gem_quiescent_gpu(fd);
> - igt_install_exit_handler(quiescent_gpu_at_exit_render);
> + igt_install_exit_handler(cancel_work_at_exit_render);
> }
>
> return fd;
> diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
> index ff8612dc6..9f81be0a2 100644
> --- a/lib/igt_debugfs.h
> +++ b/lib/igt_debugfs.h
> @@ -190,6 +190,18 @@ void igt_require_hpd_storm_ctl(int fd);
> * Flush the driver's idle_worker, releasing internal caches and wakerefs.
> */
> #define DROP_IDLE 0x40
> +/**
> + * DROP_RESET_ACTIVE:
> + *
> + * Cancel all outstanding requests by forcing a gpu reset
> + */
> +#define DROP_RESET_ACTIVE 0x80
> +/**
> + * DROP_RESET_SEQNO:
> + *
> + * Reset the global request seqno counter back to 0
> + */
> +#define DROP_RESET_SEQNO 0x100
> /**
> * DROP_ALL:
> *
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib: Cancel all outstanding requests at the end of a test
2018-09-07 16:37 ` Antonio Argenziano
@ 2018-09-07 16:44 ` Chris Wilson
-1 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-07 16:44 UTC (permalink / raw)
To: Antonio Argenziano, igt-dev; +Cc: intel-gfx
Quoting Antonio Argenziano (2018-09-07 17:37:45)
>
>
> On 07/09/18 01:41, Chris Wilson wrote:
> > Quite often on catastrophic failure the test leaves a long queue of
> > unterminated batches pending execution. Each runs until hangcheck fires
> > and skips onto the next, leaving us waiting for a very long time at test
> > exit.
> >
> > On older kernels, this gracefully degrades into the existing mechanism.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>
> LGTM. Just, if I have to be really picky, the comment for
> quiescent_gpu() says it is installed as an exit handler.
It's still correct in spirit. But no caller of quiescent_gpu() cares
because they need it for idling right there and then.
-Chris
_______________________________________________
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: [igt-dev] [PATCH i-g-t] lib: Cancel all outstanding requests at the end of a test
@ 2018-09-07 16:44 ` Chris Wilson
0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-07 16:44 UTC (permalink / raw)
To: Antonio Argenziano, igt-dev; +Cc: intel-gfx
Quoting Antonio Argenziano (2018-09-07 17:37:45)
>
>
> On 07/09/18 01:41, Chris Wilson wrote:
> > Quite often on catastrophic failure the test leaves a long queue of
> > unterminated batches pending execution. Each runs until hangcheck fires
> > and skips onto the next, leaving us waiting for a very long time at test
> > exit.
> >
> > On older kernels, this gracefully degrades into the existing mechanism.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>
> LGTM. Just, if I have to be really picky, the comment for
> quiescent_gpu() says it is installed as an exit handler.
It's still correct in spirit. But no caller of quiescent_gpu() cares
because they need it for idling right there and then.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-09-07 16:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 8:41 [PATCH i-g-t] lib: Cancel all outstanding requests at the end of a test Chris Wilson
2018-09-07 8:41 ` [igt-dev] " Chris Wilson
2018-09-07 9:39 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-09-07 16:37 ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
2018-09-07 16:37 ` Antonio Argenziano
2018-09-07 16:44 ` Chris Wilson
2018-09-07 16:44 ` 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.