From: Michel Thierry <michel.thierry@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: mesa-dev@lists.freedesktop.org
Subject: [PATCH 10/10] drm/i915: Add engine reset count in get-reset-stats ioctl
Date: Wed, 11 Jan 2017 20:18:17 -0800 [thread overview]
Message-ID: <20170112041817.1102-11-michel.thierry@intel.com> (raw)
In-Reply-To: <20170112041817.1102-1-michel.thierry@intel.com>
Users/tests relying on the total reset count will start seeing a smaller
number since most of the hangs can be handled by engine reset.
Note that if reset engine x, context a running on engine y will be unaware
and unaffected.
To start the discussion, include just a total engine reset count. If it
is deemed useful, it can be extended to report each engine separately.
v2: s/engine_reset/reset_engine/.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: mesa-dev@lists.freedesktop.org
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
---
drivers/gpu/drm/i915/i915_gem_context.c | 14 +++++++++++---
include/uapi/drm/i915_drm.h | 3 ++-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 227b428a1202..ae55e10284f0 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -1284,9 +1284,11 @@ int i915_gem_context_reset_stats_ioctl(struct drm_device *dev,
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_i915_reset_stats *args = data;
struct i915_gem_context *ctx;
+ struct intel_engine_cs *engine;
+ enum intel_engine_id id;
int ret;
- if (args->flags || args->pad)
+ if (args->flags)
return -EINVAL;
if (args->ctx_id == DEFAULT_CONTEXT_HANDLE && !capable(CAP_SYS_ADMIN))
@@ -1302,10 +1304,16 @@ int i915_gem_context_reset_stats_ioctl(struct drm_device *dev,
return PTR_ERR(ctx);
}
- if (capable(CAP_SYS_ADMIN))
+ if (capable(CAP_SYS_ADMIN)) {
args->reset_count = i915_reset_count(&dev_priv->gpu_error);
- else
+ for_each_engine(engine, dev_priv, id)
+ args->reset_engine_count +=
+ i915_reset_engine_count(&dev_priv->gpu_error,
+ engine);
+ } else {
args->reset_count = 0;
+ args->reset_engine_count = 0;
+ }
args->batch_active = ctx->guilty_count;
args->batch_pending = ctx->active_count;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 1110e628c239..58551b06409d 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1201,7 +1201,8 @@ struct drm_i915_reset_stats {
/* Number of batches lost pending for execution, for this context */
__u32 batch_pending;
- __u32 pad;
+ /* Number of engine resets since boot/module reload, for all contexts */
+ __u32 reset_engine_count;
};
struct drm_i915_gem_userptr {
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-01-12 4:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 4:18 [PATCH v4 00/10] Execlist based engine-reset (v4) Michel Thierry
2017-01-12 4:18 ` [PATCH 01/10] drm/i915: Keep i915_handle_error kerneldoc parameters together Michel Thierry
2017-01-12 4:18 ` [PATCH 02/10] drm/i915: Update i915_reset parameter for kerneldoc Michel Thierry
2017-01-12 14:12 ` Mika Kuoppala
2017-01-12 4:18 ` [PATCH 03/10] drm/i915: Update i915.reset to handle engine resets Michel Thierry
2017-01-12 12:22 ` Joonas Lahtinen
2017-01-12 13:11 ` Chris Wilson
2017-01-12 4:18 ` [PATCH 04/10] drm/i915/tdr: Modify error handler for per engine hang recovery Michel Thierry
2017-01-12 7:27 ` Chris Wilson
2017-01-12 4:18 ` [PATCH 05/10] drm/i915/tdr: Add support for per engine reset recovery Michel Thierry
2017-01-12 4:18 ` [PATCH 06/10] drm/i915: Skip reset request if there is one already Michel Thierry
2017-01-12 4:18 ` [PATCH 07/10] drm/i915/tdr: Add engine reset count to error state Michel Thierry
2017-01-12 4:18 ` [PATCH 08/10] drm/i915/tdr: Export per-engine reset count info to debugfs Michel Thierry
2017-01-12 4:18 ` [PATCH 09/10] drm/i915/tdr: Enable Engine reset and recovery support Michel Thierry
2017-01-12 4:18 ` Michel Thierry [this message]
2017-01-12 4:53 ` ✓ Fi.CI.BAT: success for Execlist based engine-reset (rev2) Patchwork
2017-01-12 7:30 ` [PATCH v4 00/10] Execlist based engine-reset (v4) Chris Wilson
2017-01-12 18:39 ` Michel Thierry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170112041817.1102-11-michel.thierry@intel.com \
--to=michel.thierry@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mesa-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.