Skip to contentSkip to conversation

drm/i915: Debugfs to disable context banning

PATCH Superseded [email protected] 3 participants 6 messages Oct 17, 2017 – Oct 18, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Debugfs to disable context banning

From: Jeff McGee <[email protected]>

Useful for stress testing various reset scenarios. The ioctl that we have for specific client/context banning disable is difficult to utilize outside of unit testing.

---
 drivers/gpu/drm/i915/i915_debugfs.c | 25 +++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_drv.h     |  2 ++
 drivers/gpu/drm/i915/i915_gem.c     |  3 ++-
 3 files changed, 29 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +25 -0
index 0bb6e01121fc..17e6b388b80c 100644
@@ -4408,6 +4408,30 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_min_freq_fops,
 			i915_min_freq_get, i915_min_freq_set,
 			"%llu\n");
 
+static int i915_banning_disable_get(void *data, u64 *val)
+{
+	struct drm_device *dev = data;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	*val = dev_priv->gpu_error.banning_disabled;
+
+	return 0;
+}
+
+static int i915_banning_disable_set(void *data, u64 val)
+{
+	struct drm_device *dev = data;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	dev_priv->gpu_error.banning_disabled = (bool)val;
+
+	return 0;
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(i915_banning_disable_fops,
+			i915_banning_disable_get, i915_banning_disable_set,
+			"%llu\n");
+
 static int
 i915_cache_sharing_get(void *data, u64 *val)
 {
@@ -4829,6 +4853,7 @@ static const struct i915_debugfs_files {
 	{"i915_guc_log_control", &i915_guc_log_control_fops},
 	{"i915_hpd_storm_ctl", &i915_hpd_storm_ctl_fops},
 	{"i915_ipc_status", &i915_ipc_status_fops}
+	{"i915_banning_disable", &i915_banning_disable_fops},
 };
 
 int i915_debugfs_register(struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index c7b2ca6aff05..da65b6f8cc6f 100644
@@ -1667,6 +1667,8 @@ struct i915_gpu_error {
 
 	/* For missed irq/seqno simulation. */
 	unsigned long test_irq_rings;
+
+	bool banning_disabled;
 };
 
 enum modeset_restore {
drivers/gpu/drm/i915/i915_gem.c +2 -1
index 20fcac37c85a..e0cb53cafc66 100644
@@ -2770,7 +2770,8 @@ i915_gem_object_pwrite_gtt(struct drm_i915_gem_object *obj,
 static bool ban_context(const struct i915_gem_context *ctx,
 			unsigned int score)
 {
-	return (i915_gem_context_is_bannable(ctx) &&
+	return (!ctx->i915->gpu_error.banning_disabled &&
+		i915_gem_context_is_bannable(ctx) &&
 		score >= CONTEXT_SCORE_BAN_THRESHOLD);
 }
 
Signature · 6 lines
2.14.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 5 lines · On Tue, Oct 17, 2017 at 08:25:33AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

Useful for stress testing various reset scenarios. The ioctl that we have for specific client/context banning disable is difficult to utilize outside of unit testing.

Do we have these stress tests available somewhere? -Daniel

Quoted 85 lines
---
 drivers/gpu/drm/i915/i915_debugfs.c | 25 +++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_drv.h     |  2 ++
 drivers/gpu/drm/i915/i915_gem.c     |  3 ++-
 3 files changed, 29 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +25 -0
index 0bb6e01121fc..17e6b388b80c 100644
@@ -4408,6 +4408,30 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_min_freq_fops,
 			i915_min_freq_get, i915_min_freq_set,
 			"%llu\n");
 
+static int i915_banning_disable_get(void *data, u64 *val)
+{
+	struct drm_device *dev = data;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	*val = dev_priv->gpu_error.banning_disabled;
+
+	return 0;
+}
+
+static int i915_banning_disable_set(void *data, u64 val)
+{
+	struct drm_device *dev = data;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	dev_priv->gpu_error.banning_disabled = (bool)val;
+
+	return 0;
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(i915_banning_disable_fops,
+			i915_banning_disable_get, i915_banning_disable_set,
+			"%llu\n");
+
 static int
 i915_cache_sharing_get(void *data, u64 *val)
 {
@@ -4829,6 +4853,7 @@ static const struct i915_debugfs_files {
 	{"i915_guc_log_control", &i915_guc_log_control_fops},
 	{"i915_hpd_storm_ctl", &i915_hpd_storm_ctl_fops},
 	{"i915_ipc_status", &i915_ipc_status_fops}
+	{"i915_banning_disable", &i915_banning_disable_fops},
 };
 
 int i915_debugfs_register(struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index c7b2ca6aff05..da65b6f8cc6f 100644
@@ -1667,6 +1667,8 @@ struct i915_gpu_error {
 
 	/* For missed irq/seqno simulation. */
 	unsigned long test_irq_rings;
+
+	bool banning_disabled;
 };
 
 enum modeset_restore {
drivers/gpu/drm/i915/i915_gem.c +2 -1
index 20fcac37c85a..e0cb53cafc66 100644
@@ -2770,7 +2770,8 @@ i915_gem_object_pwrite_gtt(struct drm_i915_gem_object *obj,
 static bool ban_context(const struct i915_gem_context *ctx,
 			unsigned int score)
 {
-	return (i915_gem_context_is_bannable(ctx) &&
+	return (!ctx->i915->gpu_error.banning_disabled &&
+		i915_gem_context_is_bannable(ctx) &&
 		score >= CONTEXT_SCORE_BAN_THRESHOLD);
 }
 
Signature · 6 lines
2.14.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#2 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 5 lines · On Tue, Oct 17, 2017 at 08:25:33AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

Useful for stress testing various reset scenarios. The ioctl that we have for specific client/context banning disable is difficult to utilize outside of unit testing.

Do we have these stress tests available somewhere? -Daniel

Potentially any test scenario that relies upon app/umd instead of IGT to inject batches that need to be reset would benefit from the ability to disable context banning. We are using such scenarios to validate for the Yocto APL project, specifically for a feature where preemption of non- preemptible batches is forced using reset. It it not needed for IGT-based reset stress tests.
-Jeff

Quoted 78 lines
Quoted 78 lines
---
 drivers/gpu/drm/i915/i915_debugfs.c | 25 +++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_drv.h     |  2 ++
 drivers/gpu/drm/i915/i915_gem.c     |  3 ++-
 3 files changed, 29 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +25 -0
index 0bb6e01121fc..17e6b388b80c 100644
@@ -4408,6 +4408,30 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_min_freq_fops,
 			i915_min_freq_get, i915_min_freq_set,
 			"%llu\n");
 
+static int i915_banning_disable_get(void *data, u64 *val)
+{
+	struct drm_device *dev = data;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	*val = dev_priv->gpu_error.banning_disabled;
+
+	return 0;
+}
+
+static int i915_banning_disable_set(void *data, u64 val)
+{
+	struct drm_device *dev = data;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	dev_priv->gpu_error.banning_disabled = (bool)val;
+
+	return 0;
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(i915_banning_disable_fops,
+			i915_banning_disable_get, i915_banning_disable_set,
+			"%llu\n");
+
 static int
 i915_cache_sharing_get(void *data, u64 *val)
 {
@@ -4829,6 +4853,7 @@ static const struct i915_debugfs_files {
 	{"i915_guc_log_control", &i915_guc_log_control_fops},
 	{"i915_hpd_storm_ctl", &i915_hpd_storm_ctl_fops},
 	{"i915_ipc_status", &i915_ipc_status_fops}
+	{"i915_banning_disable", &i915_banning_disable_fops},
 };
 
 int i915_debugfs_register(struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index c7b2ca6aff05..da65b6f8cc6f 100644
@@ -1667,6 +1667,8 @@ struct i915_gpu_error {
 
 	/* For missed irq/seqno simulation. */
 	unsigned long test_irq_rings;
+
+	bool banning_disabled;
 };
 
 enum modeset_restore {
drivers/gpu/drm/i915/i915_gem.c +2 -1
index 20fcac37c85a..e0cb53cafc66 100644
@@ -2770,7 +2770,8 @@ i915_gem_object_pwrite_gtt(struct drm_i915_gem_object *obj,
 static bool ban_context(const struct i915_gem_context *ctx,
 			unsigned int score)
 {
-	return (i915_gem_context_is_bannable(ctx) &&
+	return (!ctx->i915->gpu_error.banning_disabled &&
+		i915_gem_context_is_bannable(ctx) &&
 		score >= CONTEXT_SCORE_BAN_THRESHOLD);
 }
 
Quoted 12 lines
Quoted 7 lines
Signature · 6 lines
2.14.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Debugfs to disable context banning

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: drm/i915: Debugfs to disable context banning
URL : https://patchwork.freedesktop.org/series/32144/
State : failure

== Summary ==

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
  CC [M]  drivers/gpu/drm/i915/i915_debugfs.o

drivers/gpu/drm/i915/i915_debugfs.c:4838:2: error: expected ‘}’ before ‘{’ token
{"i915_banning_disable", &i915_banning_disable_fops},
^
scripts/Makefile.build:313: recipe for target 'drivers/gpu/drm/i915/i915_debugfs.o' failed make[4]: *** [drivers/gpu/drm/i915/i915_debugfs.o] Error 1 scripts/Makefile.build:572: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:572: recipe for target 'drivers/gpu/drm' failed make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:572: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1023: recipe for target 'drivers' failed
make: *** [drivers] Error 2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
In reply to Jeff McGee
Quoted 11 lines · Jeff McGee
Quoted 10 lines · Daniel Vetter
Quoted 5 lines · On Tue, Oct 17, 2017 at 08:25:33AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

Useful for stress testing various reset scenarios. The ioctl that we have for specific client/context banning disable is difficult to utilize outside of unit testing.

Do we have these stress tests available somewhere? -Daniel

Quoted 6 lines

Potentially any test scenario that relies upon app/umd instead of IGT to inject batches that need to be reset would benefit from the ability to disable context banning. We are using such scenarios to validate for the Yocto APL project, specifically for a feature where preemption of non- preemptible batches is forced using reset. It it not needed for IGT-based reset stress tests.

Is that test suite public somewhere?
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#4 lore raw
Quoted 19 lines · Daniel Vetter
Quoted 11 lines · Jeff McGee
Quoted 10 lines · Daniel Vetter
Quoted 5 lines · On Tue, Oct 17, 2017 at 08:25:33AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

Useful for stress testing various reset scenarios. The ioctl that we have for specific client/context banning disable is difficult to utilize outside of unit testing.

Do we have these stress tests available somewhere? -Daniel

Quoted 6 lines

Potentially any test scenario that relies upon app/umd instead of IGT to inject batches that need to be reset would benefit from the ability to disable context banning. We are using such scenarios to validate for the Yocto APL project, specifically for a feature where preemption of non- preemptible batches is forced using reset. It it not needed for IGT-based reset stress tests.

Quoted 2 lines

Is that test suite public somewhere?
-Daniel

No, but it could be. I don't own it. Anyway, I'll reintroduce this patch when I have a better case to make for it. It was worth a try ;) -Jeff
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx