Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check
@ 2021-04-08  8:30 Janusz Krzysztofik
  2021-04-08  8:30 ` [Intel-gfx] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests Janusz Krzysztofik
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Janusz Krzysztofik @ 2021-04-08  8:30 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

Sometimes CI reports skips of perf subtests when run subsequently after
core_hotunplug.  That may be an indication of issues with restoring
device perf features on driver (hot)rebind.

Detect device perf support at test start and check if still available
after driver rebind.  If that fails, a post-subtest device recovery
step restores the device perf support so no subsequently executed tests
are affected.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 tests/core_hotunplug.c | 22 ++++++++++++++++++++++
 tests/meson.build      |  8 +++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 56a88fefd..06f15d845 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -31,6 +31,7 @@
 #include <unistd.h>
 
 #include "i915/gem.h"
+#include "i915/perf.h"
 #include "igt.h"
 #include "igt_device_scan.h"
 #include "igt_kmod.h"
@@ -50,6 +51,7 @@ struct hotunplug {
 	const char *dev_bus_addr;
 	const char *failure;
 	bool need_healthcheck;
+	bool has_intel_perf;
 };
 
 /* Helpers */
@@ -319,6 +321,16 @@ static int local_i915_recover(int i915)
 	return local_i915_healthcheck(i915, "post-");
 }
 
+static bool local_i915_perf_healthcheck(int i915)
+{
+	struct intel_perf *intel_perf;
+
+	intel_perf = intel_perf_for_fd(i915);
+	if (intel_perf)
+		intel_perf_free(intel_perf);
+	return intel_perf;
+}
+
 #define FLAG_RENDER	(1 << 0)
 #define FLAG_RECOVER	(1 << 1)
 static void node_healthcheck(struct hotunplug *priv, unsigned flags)
@@ -360,6 +372,13 @@ static void node_healthcheck(struct hotunplug *priv, unsigned flags)
 		}
 	}
 
+	if (!priv->failure && priv->has_intel_perf) {
+		local_debug("%s\n", "running i915 device perf healthcheck");
+		priv->failure = "Device perf healthckeck failure!";
+		if (local_i915_perf_healthcheck(fd_drm))
+			priv->failure = NULL;
+	}
+
 	fd_drm = close_device(fd_drm, "", "health checked ");
 	if (closed || fd_drm < -1)	/* update status for post_healthcheck */
 		priv->fd.drm_hc = fd_drm;
@@ -553,6 +572,7 @@ igt_main
 		.fd		= { .drm = -1, .drm_hc = -1, .sysfs_dev = -1, },
 		.failure	= NULL,
 		.need_healthcheck = true,
+		.has_intel_perf = false,
 	};
 
 	igt_fixture {
@@ -567,6 +587,8 @@ igt_main
 			gem_quiescent_gpu(fd_drm);
 			igt_require_gem(fd_drm);
 
+			priv.has_intel_perf = local_i915_perf_healthcheck(fd_drm);
+
 			/**
 			 * FIXME: Unbinding the i915 driver on some Haswell
 			 * platforms with Azalia audio results in a kernel WARN
diff --git a/tests/meson.build b/tests/meson.build
index 3e3db7d5b..3f6dc4fe3 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -3,7 +3,6 @@ test_progs = [
 	'core_getclient',
 	'core_getstats',
 	'core_getversion',
-	'core_hotunplug',
 	'core_setmaster',
 	'core_setmaster_vs_auth',
 	'debugfs_test',
@@ -361,6 +360,13 @@ test_executables += executable('perf',
 	   install : true)
 test_list += 'perf'
 
+test_executables += executable('core_hotunplug', 'core_hotunplug.c',
+	   dependencies : test_deps + [ lib_igt_i915_perf ],
+	   install_dir : libexecdir,
+	   install_rpath : libexecdir_rpathdir,
+	   install : true)
+test_list += 'core_hotunplug'
+
 executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
 	   dependencies : test_deps,
 	   install_dir : libexecdir,
-- 
2.25.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] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests
  2021-04-08  8:30 [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check Janusz Krzysztofik
@ 2021-04-08  8:30 ` Janusz Krzysztofik
  2021-04-14  9:52   ` Marcin Bernatowicz
  2021-04-08  8:35 ` [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check Janusz Krzysztofik
  2021-04-08 12:34 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [RFC,1/2] " Patchwork
  2 siblings, 1 reply; 6+ messages in thread
From: Janusz Krzysztofik @ 2021-04-08  8:30 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

Commit be529747d8ea ("intel-ci: Broaden core_hotunplug blacklist")
blamed issues triggered by hot variants[*] as responsible for random
failures in subsequently executed tests,

According to the issue history[*], last reported occurrences were
not related to core_hotunplug.  Remove *hot*bind* subtests from CI
blocklist.

[*] https://gitlab.freedesktop.org/drm/intel/-/issues/2644.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 tests/intel-ci/blacklist.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/intel-ci/blacklist.txt b/tests/intel-ci/blacklist.txt
index 33f92e37f..595fd0ca6 100644
--- a/tests/intel-ci/blacklist.txt
+++ b/tests/intel-ci/blacklist.txt
@@ -112,10 +112,10 @@ igt@.*@.*pipe-f($|-.*)
 # Temporary workarounds for CI-impacting bugs
 ###############################################
 
-# Currently fails and leaves the machine in a very bad state, and
-# causes coverage loss for other tests. IOMMU related.
-# https://gitlab.freedesktop.org/drm/intel/-/issues/2644
-igt@core_hotunplug@.*(hot|plug).*
+# *plug* subtests still fail and leave the
+# machine in a very bad state, causing coverage
+# loss for other tests.  IOMMU related.
+igt@core_hotunplug@.*plug.*
 
 # hangs several gens of hosts, and has no immediate fix
 igt@device_reset@reset-bound
-- 
2.25.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] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests
  2021-04-08  8:31 [Intel-gfx] [RFC PATCH 1/2] " Janusz Krzysztofik
@ 2021-04-08  8:31 ` Janusz Krzysztofik
  0 siblings, 0 replies; 6+ messages in thread
From: Janusz Krzysztofik @ 2021-04-08  8:31 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

Commit be529747d8ea ("intel-ci: Broaden core_hotunplug blacklist")
blamed issues triggered by hot variants[*] as responsible for random
failures in subsequently executed tests,

According to the issue history[*], last reported occurrences were
not related to core_hotunplug.  Remove *hot*bind* subtests from CI
blocklist.

[*] https://gitlab.freedesktop.org/drm/intel/-/issues/2644.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 tests/intel-ci/blacklist.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/intel-ci/blacklist.txt b/tests/intel-ci/blacklist.txt
index 33f92e37f..595fd0ca6 100644
--- a/tests/intel-ci/blacklist.txt
+++ b/tests/intel-ci/blacklist.txt
@@ -112,10 +112,10 @@ igt@.*@.*pipe-f($|-.*)
 # Temporary workarounds for CI-impacting bugs
 ###############################################
 
-# Currently fails and leaves the machine in a very bad state, and
-# causes coverage loss for other tests. IOMMU related.
-# https://gitlab.freedesktop.org/drm/intel/-/issues/2644
-igt@core_hotunplug@.*(hot|plug).*
+# *plug* subtests still fail and leave the
+# machine in a very bad state, causing coverage
+# loss for other tests.  IOMMU related.
+igt@core_hotunplug@.*plug.*
 
 # hangs several gens of hosts, and has no immediate fix
 igt@device_reset@reset-bound
-- 
2.25.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

* Re: [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check
  2021-04-08  8:30 [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check Janusz Krzysztofik
  2021-04-08  8:30 ` [Intel-gfx] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests Janusz Krzysztofik
@ 2021-04-08  8:35 ` Janusz Krzysztofik
  2021-04-08 12:34 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [RFC,1/2] " Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Janusz Krzysztofik @ 2021-04-08  8:35 UTC (permalink / raw)
  To: intel-gfx

Sorry for double submission, I had to resend due to a typo in igt-dev list 
address.

Janusz

On czwartek, 8 kwietnia 2021 10:30:08 CEST Janusz Krzysztofik wrote:
> Sometimes CI reports skips of perf subtests when run subsequently after
> core_hotunplug.  That may be an indication of issues with restoring
> device perf features on driver (hot)rebind.
> 
> Detect device perf support at test start and check if still available
> after driver rebind.  If that fails, a post-subtest device recovery
> step restores the device perf support so no subsequently executed tests
> are affected.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> ---
>  tests/core_hotunplug.c | 22 ++++++++++++++++++++++
>  tests/meson.build      |  8 +++++++-
>  2 files changed, 29 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
> index 56a88fefd..06f15d845 100644
> --- a/tests/core_hotunplug.c
> +++ b/tests/core_hotunplug.c
> @@ -31,6 +31,7 @@
>  #include <unistd.h>
>  
>  #include "i915/gem.h"
> +#include "i915/perf.h"
>  #include "igt.h"
>  #include "igt_device_scan.h"
>  #include "igt_kmod.h"
> @@ -50,6 +51,7 @@ struct hotunplug {
>  	const char *dev_bus_addr;
>  	const char *failure;
>  	bool need_healthcheck;
> +	bool has_intel_perf;
>  };
>  
>  /* Helpers */
> @@ -319,6 +321,16 @@ static int local_i915_recover(int i915)
>  	return local_i915_healthcheck(i915, "post-");
>  }
>  
> +static bool local_i915_perf_healthcheck(int i915)
> +{
> +	struct intel_perf *intel_perf;
> +
> +	intel_perf = intel_perf_for_fd(i915);
> +	if (intel_perf)
> +		intel_perf_free(intel_perf);
> +	return intel_perf;
> +}
> +
>  #define FLAG_RENDER	(1 << 0)
>  #define FLAG_RECOVER	(1 << 1)
>  static void node_healthcheck(struct hotunplug *priv, unsigned flags)
> @@ -360,6 +372,13 @@ static void node_healthcheck(struct hotunplug *priv, unsigned flags)
>  		}
>  	}
>  
> +	if (!priv->failure && priv->has_intel_perf) {
> +		local_debug("%s\n", "running i915 device perf healthcheck");
> +		priv->failure = "Device perf healthckeck failure!";
> +		if (local_i915_perf_healthcheck(fd_drm))
> +			priv->failure = NULL;
> +	}
> +
>  	fd_drm = close_device(fd_drm, "", "health checked ");
>  	if (closed || fd_drm < -1)	/* update status for post_healthcheck */
>  		priv->fd.drm_hc = fd_drm;
> @@ -553,6 +572,7 @@ igt_main
>  		.fd		= { .drm = -1, .drm_hc = -1, .sysfs_dev = -1, },
>  		.failure	= NULL,
>  		.need_healthcheck = true,
> +		.has_intel_perf = false,
>  	};
>  
>  	igt_fixture {
> @@ -567,6 +587,8 @@ igt_main
>  			gem_quiescent_gpu(fd_drm);
>  			igt_require_gem(fd_drm);
>  
> +			priv.has_intel_perf = local_i915_perf_healthcheck(fd_drm);
> +
>  			/**
>  			 * FIXME: Unbinding the i915 driver on some Haswell
>  			 * platforms with Azalia audio results in a kernel WARN
> diff --git a/tests/meson.build b/tests/meson.build
> index 3e3db7d5b..3f6dc4fe3 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -3,7 +3,6 @@ test_progs = [
>  	'core_getclient',
>  	'core_getstats',
>  	'core_getversion',
> -	'core_hotunplug',
>  	'core_setmaster',
>  	'core_setmaster_vs_auth',
>  	'debugfs_test',
> @@ -361,6 +360,13 @@ test_executables += executable('perf',
>  	   install : true)
>  test_list += 'perf'
>  
> +test_executables += executable('core_hotunplug', 'core_hotunplug.c',
> +	   dependencies : test_deps + [ lib_igt_i915_perf ],
> +	   install_dir : libexecdir,
> +	   install_rpath : libexecdir_rpathdir,
> +	   install : true)
> +test_list += 'core_hotunplug'
> +
>  executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
>  	   dependencies : test_deps,
>  	   install_dir : libexecdir,
> 




_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [RFC,1/2] tests/core_hotunplug: Add perf health check
  2021-04-08  8:30 [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check Janusz Krzysztofik
  2021-04-08  8:30 ` [Intel-gfx] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests Janusz Krzysztofik
  2021-04-08  8:35 ` [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check Janusz Krzysztofik
@ 2021-04-08 12:34 ` Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2021-04-08 12:34 UTC (permalink / raw)
  To: Janusz Krzysztofik; +Cc: intel-gfx

== Series Details ==

Series: series starting with [RFC,1/2] tests/core_hotunplug: Add perf health check
URL   : https://patchwork.freedesktop.org/series/88845/
State : failure

== Summary ==

Applying: tests/core_hotunplug: Add perf health check
error: sha1 information is lacking or useless (tests/core_hotunplug.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 tests/core_hotunplug: Add perf health check
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests
  2021-04-08  8:30 ` [Intel-gfx] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests Janusz Krzysztofik
@ 2021-04-14  9:52   ` Marcin Bernatowicz
  0 siblings, 0 replies; 6+ messages in thread
From: Marcin Bernatowicz @ 2021-04-14  9:52 UTC (permalink / raw)
  To: Janusz Krzysztofik, igt-dev; +Cc: intel-gfx

On Thu, 2021-04-08 at 10:30 +0200, Janusz Krzysztofik wrote:
> Commit be529747d8ea ("intel-ci: Broaden core_hotunplug blacklist")
> blamed issues triggered by hot variants[*] as responsible for random
> failures in subsequently executed tests,
> 
> According to the issue history[*], last reported occurrences were
> not related to core_hotunplug.  Remove *hot*bind* subtests from CI
> blocklist.
> 
> [*] https://gitlab.freedesktop.org/drm/intel/-/issues/2644.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com
> >
> ---
>  tests/intel-ci/blacklist.txt | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/intel-ci/blacklist.txt b/tests/intel-
> ci/blacklist.txt
> index 33f92e37f..595fd0ca6 100644
> --- a/tests/intel-ci/blacklist.txt
> +++ b/tests/intel-ci/blacklist.txt
> @@ -112,10 +112,10 @@ igt@.*@.*pipe-f($|-.*)
>  # Temporary workarounds for CI-impacting bugs
>  ###############################################
>  
> -# Currently fails and leaves the machine in a very bad state, and
> -# causes coverage loss for other tests. IOMMU related.
> -# https://gitlab.freedesktop.org/drm/intel/-/issues/2644
> -igt@core_hotunplug@.*(hot|plug).*
> +# *plug* subtests still fail and leave the
> +# machine in a very bad state, causing coverage
> +# loss for other tests.  IOMMU related.
> +igt@core_hotunplug@.*plug.*

LGTM,
Acked-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>

>  
>  # hangs several gens of hosts, and has no immediate fix
>  igt@device_reset@reset-bound

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2021-04-14  9:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-08  8:30 [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check Janusz Krzysztofik
2021-04-08  8:30 ` [Intel-gfx] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests Janusz Krzysztofik
2021-04-14  9:52   ` Marcin Bernatowicz
2021-04-08  8:35 ` [Intel-gfx] [RFC PATCH 1/2] tests/core_hotunplug: Add perf health check Janusz Krzysztofik
2021-04-08 12:34 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [RFC,1/2] " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2021-04-08  8:31 [Intel-gfx] [RFC PATCH 1/2] " Janusz Krzysztofik
2021-04-08  8:31 ` [Intel-gfx] [RFC PATCH 2/2] intel-ci: Unblock core_hotunplug@*hot*bind* subtests Janusz Krzysztofik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox