From: Arun Siluvery <arun.siluvery@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 08/62] drm/i915: Remove stop-rings debugfs interface
Date: Wed, 8 Jun 2016 17:20:51 +0530 [thread overview]
Message-ID: <5758069B.2040401@linux.intel.com> (raw)
In-Reply-To: <1464971847-15809-9-git-send-email-chris@chris-wilson.co.uk>
On 03/06/2016 22:06, Chris Wilson wrote:
> Now that we have (near) universal GPU recovery code, we can inject a
> real hang from userspace and not need any fakery. Not only does this
> mean that the testing is far more realistic, but we can simplify the
> kernel in the process.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 35 --------------------------
> drivers/gpu/drm/i915/i915_drv.c | 17 ++-----------
> drivers/gpu/drm/i915/i915_drv.h | 19 --------------
> drivers/gpu/drm/i915/i915_gem.c | 44 ++++++++++-----------------------
> drivers/gpu/drm/i915/intel_lrc.c | 3 ---
> drivers/gpu/drm/i915/intel_ringbuffer.c | 8 ------
> drivers/gpu/drm/i915/intel_ringbuffer.h | 1 -
> 7 files changed, 15 insertions(+), 112 deletions(-)
>
looks good to me,
Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com>
regards
Arun
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index dd6cf222e8f5..8f576b443ff6 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4821,40 +4821,6 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_wedged_fops,
> "%llu\n");
>
> static int
> -i915_ring_stop_get(void *data, u64 *val)
> -{
> - struct drm_device *dev = data;
> - struct drm_i915_private *dev_priv = dev->dev_private;
> -
> - *val = dev_priv->gpu_error.stop_rings;
> -
> - return 0;
> -}
> -
> -static int
> -i915_ring_stop_set(void *data, u64 val)
> -{
> - struct drm_device *dev = data;
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - int ret;
> -
> - DRM_DEBUG_DRIVER("Stopping rings 0x%08llx\n", val);
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
> -
> - dev_priv->gpu_error.stop_rings = val;
> - mutex_unlock(&dev->struct_mutex);
> -
> - return 0;
> -}
> -
> -DEFINE_SIMPLE_ATTRIBUTE(i915_ring_stop_fops,
> - i915_ring_stop_get, i915_ring_stop_set,
> - "0x%08llx\n");
> -
> -static int
> i915_ring_missed_irq_get(void *data, u64 *val)
> {
> struct drm_device *dev = data;
> @@ -5457,7 +5423,6 @@ static const struct i915_debugfs_files {
> {"i915_max_freq", &i915_max_freq_fops},
> {"i915_min_freq", &i915_min_freq_fops},
> {"i915_cache_sharing", &i915_cache_sharing_fops},
> - {"i915_ring_stop", &i915_ring_stop_fops},
> {"i915_ring_missed_irq", &i915_ring_missed_irq_fops},
> {"i915_ring_test_irq", &i915_ring_test_irq_fops},
> {"i915_gem_drop_caches", &i915_drop_caches_fops},
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 7ba040141722..f2ac0cae929b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -2125,24 +2125,11 @@ int i915_reset(struct drm_i915_private *dev_priv)
> goto error;
> }
>
> + pr_notice("drm/i915: Resetting chip after gpu hang\n");
> +
> i915_gem_reset(dev);
>
> ret = intel_gpu_reset(dev_priv, ALL_ENGINES);
> -
> - /* Also reset the gpu hangman. */
> - if (error->stop_rings != 0) {
> - DRM_INFO("Simulated gpu hang, resetting stop_rings\n");
> - error->stop_rings = 0;
> - if (ret == -ENODEV) {
> - DRM_INFO("Reset not implemented, but ignoring "
> - "error for simulated gpu hangs\n");
> - ret = 0;
> - }
> - }
> -
> - if (i915_stop_ring_allow_warn(dev_priv))
> - pr_notice("drm/i915: Resetting chip after gpu hang\n");
> -
> if (ret) {
> if (ret != -ENODEV)
> DRM_ERROR("Failed to reset chip: %i\n", ret);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 3f075adf9e84..a48c0f4e1d42 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1393,13 +1393,6 @@ struct i915_gpu_error {
> */
> wait_queue_head_t reset_queue;
>
> - /* Userspace knobs for gpu hang simulation;
> - * combines both a ring mask, and extra flags
> - */
> - u32 stop_rings;
> -#define I915_STOP_RING_ALLOW_BAN (1 << 31)
> -#define I915_STOP_RING_ALLOW_WARN (1 << 30)
> -
> /* For missed irq/seqno simulation. */
> unsigned long test_irq_rings;
> };
> @@ -3292,18 +3285,6 @@ static inline u32 i915_reset_count(struct i915_gpu_error *error)
> return ((i915_reset_counter(error) & ~I915_WEDGED) + 1) / 2;
> }
>
> -static inline bool i915_stop_ring_allow_ban(struct drm_i915_private *dev_priv)
> -{
> - return dev_priv->gpu_error.stop_rings == 0 ||
> - dev_priv->gpu_error.stop_rings & I915_STOP_RING_ALLOW_BAN;
> -}
> -
> -static inline bool i915_stop_ring_allow_warn(struct drm_i915_private *dev_priv)
> -{
> - return dev_priv->gpu_error.stop_rings == 0 ||
> - dev_priv->gpu_error.stop_rings & I915_STOP_RING_ALLOW_WARN;
> -}
> -
> void i915_gem_reset(struct drm_device *dev);
> bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, bool force);
> int __must_check i915_gem_init(struct drm_device *dev);
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 0f487e3b920c..f48f54193972 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2703,44 +2703,30 @@ void __i915_add_request(struct drm_i915_gem_request *request,
> i915_gem_mark_busy(dev_priv, engine);
> }
>
> -static bool i915_context_is_banned(struct drm_i915_private *dev_priv,
> - const struct i915_gem_context *ctx)
> +static bool i915_context_is_banned(const struct i915_gem_context *ctx)
> {
> unsigned long elapsed;
>
> - elapsed = get_seconds() - ctx->hang_stats.guilty_ts;
> -
> if (ctx->hang_stats.banned)
> return true;
>
> + elapsed = get_seconds() - ctx->hang_stats.guilty_ts;
> if (ctx->hang_stats.ban_period_seconds &&
> elapsed <= ctx->hang_stats.ban_period_seconds) {
> - if (!i915_gem_context_is_default(ctx)) {
> - DRM_DEBUG("context hanging too fast, banning!\n");
> - return true;
> - } else if (i915_stop_ring_allow_ban(dev_priv)) {
> - if (i915_stop_ring_allow_warn(dev_priv))
> - DRM_ERROR("gpu hanging too fast, banning!\n");
> - return true;
> - }
> + DRM_DEBUG("context hanging too fast, banning!\n");
> + return true;
> }
>
> return false;
> }
>
> -static void i915_set_reset_status(struct drm_i915_private *dev_priv,
> - struct i915_gem_context *ctx,
> +static void i915_set_reset_status(struct i915_gem_context *ctx,
> const bool guilty)
> {
> - struct i915_ctx_hang_stats *hs;
> -
> - if (WARN_ON(!ctx))
> - return;
> -
> - hs = &ctx->hang_stats;
> + struct i915_ctx_hang_stats *hs = &ctx->hang_stats;
>
> if (guilty) {
> - hs->banned = i915_context_is_banned(dev_priv, ctx);
> + hs->banned = i915_context_is_banned(ctx);
> hs->batch_active++;
> hs->guilty_ts = get_seconds();
> } else {
> @@ -2867,27 +2853,23 @@ i915_gem_find_active_request(struct intel_engine_cs *engine)
> return NULL;
> }
>
> -static void i915_gem_reset_engine_status(struct drm_i915_private *dev_priv,
> - struct intel_engine_cs *engine)
> +static void i915_gem_reset_engine_status(struct intel_engine_cs *engine)
> {
> struct drm_i915_gem_request *request;
> bool ring_hung;
>
> request = i915_gem_find_active_request(engine);
> -
> if (request == NULL)
> return;
>
> ring_hung = engine->hangcheck.score >= HANGCHECK_SCORE_RING_HUNG;
>
> - i915_set_reset_status(dev_priv, request->ctx, ring_hung);
> -
> + i915_set_reset_status(request->ctx, ring_hung);
> list_for_each_entry_continue(request, &engine->request_list, list)
> - i915_set_reset_status(dev_priv, request->ctx, false);
> + i915_set_reset_status(request->ctx, false);
> }
>
> -static void i915_gem_reset_engine_cleanup(struct drm_i915_private *dev_priv,
> - struct intel_engine_cs *engine)
> +static void i915_gem_reset_engine_cleanup(struct intel_engine_cs *engine)
> {
> struct intel_ringbuffer *buffer;
>
> @@ -2957,10 +2939,10 @@ void i915_gem_reset(struct drm_device *dev)
> * their reference to the objects, the inspection must be done first.
> */
> for_each_engine(engine, dev_priv)
> - i915_gem_reset_engine_status(dev_priv, engine);
> + i915_gem_reset_engine_status(engine);
>
> for_each_engine(engine, dev_priv)
> - i915_gem_reset_engine_cleanup(dev_priv, engine);
> + i915_gem_reset_engine_cleanup(engine);
>
> i915_gem_context_reset(dev);
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 9e19b2c5b3ae..0742a849acce 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -764,9 +764,6 @@ intel_logical_ring_advance_and_submit(struct drm_i915_gem_request *request)
> intel_logical_ring_emit(ringbuf, MI_NOOP);
> intel_logical_ring_advance(ringbuf);
>
> - if (intel_engine_stopped(engine))
> - return 0;
> -
> /* We keep the previous context alive until we retire the following
> * request. This ensures that any the context object is still pinned
> * for any residual writes the HW makes into it on the context switch
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 161c0792b1bf..327ad7fdf118 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -58,18 +58,10 @@ void intel_ring_update_space(struct intel_ringbuffer *ringbuf)
> ringbuf->tail, ringbuf->size);
> }
>
> -bool intel_engine_stopped(struct intel_engine_cs *engine)
> -{
> - struct drm_i915_private *dev_priv = engine->i915;
> - return dev_priv->gpu_error.stop_rings & intel_engine_flag(engine);
> -}
> -
> static void __intel_ring_advance(struct intel_engine_cs *engine)
> {
> struct intel_ringbuffer *ringbuf = engine->buffer;
> ringbuf->tail &= ringbuf->size - 1;
> - if (intel_engine_stopped(engine))
> - return;
> engine->write_tail(engine, ringbuf->tail);
> }
>
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index d0cd9a1aa80e..6017367e94fb 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -480,7 +480,6 @@ static inline void intel_ring_advance(struct intel_engine_cs *engine)
> }
> int __intel_ring_space(int head, int tail, int size);
> void intel_ring_update_space(struct intel_ringbuffer *ringbuf);
> -bool intel_engine_stopped(struct intel_engine_cs *engine);
>
> int __must_check intel_engine_idle(struct intel_engine_cs *engine);
> void intel_ring_init_seqno(struct intel_engine_cs *engine, u32 seqno);
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-06-08 11:50 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 16:36 The vma leak fix from yonder Chris Wilson
2016-06-03 16:36 ` [PATCH 01/62] drm/i915: Only start retire worker when idle Chris Wilson
2016-06-07 11:31 ` Joonas Lahtinen
2016-06-08 10:53 ` Chris Wilson
2016-06-08 11:06 ` Chris Wilson
2016-06-08 12:07 ` Joonas Lahtinen
2016-06-03 16:36 ` [PATCH 02/62] drm/i915: Do not keep postponing the idle-work Chris Wilson
2016-06-07 11:34 ` Joonas Lahtinen
2016-06-03 16:36 ` [PATCH 03/62] drm/i915: Remove redundant queue_delayed_work() from throttle ioctl Chris Wilson
2016-06-07 11:39 ` Joonas Lahtinen
2016-06-03 16:36 ` [PATCH 04/62] drm/i915: Restore waitboost credit to the synchronous waiter Chris Wilson
2016-06-08 9:04 ` Daniel Vetter
2016-06-08 10:38 ` Chris Wilson
2016-06-03 16:36 ` [PATCH 05/62] drm/i915: Add background commentary to "waitboosting" Chris Wilson
2016-06-03 16:36 ` [PATCH 06/62] drm/i915: Flush the RPS bottom-half when the GPU idles Chris Wilson
2016-06-16 8:49 ` Michał Winiarski
2016-06-16 11:09 ` Chris Wilson
2016-06-03 16:36 ` [PATCH 07/62] drm/i915: Remove temporary RPM wakeref assert disables Chris Wilson
2016-06-03 16:36 ` [PATCH 08/62] drm/i915: Remove stop-rings debugfs interface Chris Wilson
2016-06-08 11:50 ` Arun Siluvery [this message]
2016-06-03 16:36 ` [PATCH 09/62] drm/i915: Record the ringbuffer associated with the request Chris Wilson
2016-06-03 16:36 ` [PATCH 10/62] drm/i915: Allow userspace to request no-error-capture upon GPU hangs Chris Wilson
2016-06-03 16:36 ` [PATCH 11/62] drm/i915: Clean up GPU hang message Chris Wilson
2016-06-14 8:13 ` Mika Kuoppala
2016-06-03 16:36 ` [PATCH 12/62] drm/i915: Skip capturing an error state if we already have one Chris Wilson
2016-06-08 11:14 ` Arun Siluvery
2016-06-08 12:06 ` Chris Wilson
2016-06-03 16:36 ` [PATCH 13/62] drm/i915: Derive GEM requests from dma-fence Chris Wilson
2016-06-08 9:14 ` Daniel Vetter
2016-06-08 10:33 ` Chris Wilson
2016-06-03 16:36 ` [PATCH 14/62] drm/i915: Rename request reference/unreference to get/put Chris Wilson
2016-06-08 9:15 ` Daniel Vetter
2016-06-03 16:36 ` [PATCH 15/62] drm/i915: Rename i915_gem_context_reference/unreference() Chris Wilson
2016-06-06 12:12 ` Joonas Lahtinen
2016-06-03 16:36 ` [PATCH 16/62] drm/i915: Wrap drm_gem_object_lookup in i915_gem_object_lookup Chris Wilson
2016-06-03 16:36 ` [PATCH 17/62] drm/i915: Wrap drm_gem_object_reference in i915_gem_object_get Chris Wilson
2016-06-03 16:36 ` [PATCH 18/62] drm/i915: Rename drm_gem_object_unreference in preparation for lockless free Chris Wilson
2016-06-03 16:36 ` [PATCH 19/62] drm/i915: Rename drm_gem_object_unreference_unlocked " Chris Wilson
2016-06-03 16:36 ` [PATCH 20/62] drm/i915: Disable waitboosting for fence_wait() Chris Wilson
2016-06-03 16:36 ` [PATCH 21/62] drm/i915: Disable waitboosting for mmioflips/semaphores Chris Wilson
2016-06-03 16:36 ` [PATCH 22/62] drm/i915: Treat ringbuffer writes as write to normal memory Chris Wilson
2016-06-03 16:36 ` [PATCH 23/62] drm/i915: Rename ring->virtual_start as ring->vaddr Chris Wilson
2016-06-03 16:36 ` [PATCH 24/62] drm/i915: Convert i915_semaphores_is_enabled over to early sanitize Chris Wilson
2016-06-03 16:36 ` [PATCH 25/62] drm/i915: Unify intel_logical_ring_emit and intel_ring_emit Chris Wilson
2016-06-03 16:36 ` [PATCH 26/62] drm/i915: Rename request->ring to request->engine Chris Wilson
2016-06-06 13:42 ` Tvrtko Ursulin
2016-06-03 16:36 ` [PATCH 27/62] drm/i915: Rename request->ringbuf to request->ring Chris Wilson
2016-06-06 13:44 ` Tvrtko Ursulin
2016-06-08 9:18 ` Daniel Vetter
2016-06-03 16:36 ` [PATCH 28/62] drm/i915: Rename backpointer from intel_ringbuffer to intel_engine_cs Chris Wilson
2016-06-06 13:45 ` Tvrtko Ursulin
2016-06-03 16:36 ` [PATCH 29/62] drm/i915: Rename intel_context[engine].ringbuf Chris Wilson
2016-06-03 16:36 ` [PATCH 30/62] drm/i915: Rename struct intel_ringbuffer to struct intel_ring Chris Wilson
2016-06-03 16:36 ` [PATCH 31/62] drm/i915: Rename residual ringbuf parameters Chris Wilson
2016-06-03 16:36 ` [PATCH 32/62] drm/i915: Rename intel_pin_and_map_ring() Chris Wilson
2016-06-03 16:36 ` [PATCH 33/62] drm/i915: Remove obsolete engine->gpu_caches_dirty Chris Wilson
2016-06-03 16:36 ` [PATCH 34/62] drm/i915: Simplify request_alloc by returning the allocated request Chris Wilson
2016-06-03 16:37 ` [PATCH 35/62] drm/i915: Unify legacy/execlists emission of MI_BATCHBUFFER_START Chris Wilson
2016-06-03 16:37 ` [PATCH 36/62] drm/i915: Convert engine->write_tail to operate on a request Chris Wilson
2016-06-03 16:37 ` [PATCH 37/62] drm/i915: Unify request submission Chris Wilson
2016-06-03 16:37 ` [PATCH 38/62] drm/i915: Stop passing caller's num_dwords to engine->semaphore.signal() Chris Wilson
2016-06-03 16:37 ` [PATCH 39/62] drm/i915: Reuse legacy breadcrumbs + tail emission Chris Wilson
2016-06-03 16:37 ` [PATCH 40/62] drm/i915: Remove duplicate golden render state init from execlists Chris Wilson
2016-06-03 16:37 ` [PATCH 41/62] drm/i915: Unify legacy/execlists submit_execbuf callbacks Chris Wilson
2016-06-03 16:37 ` [PATCH 42/62] drm/i915: Simplify calling engine->sync_to Chris Wilson
2016-06-03 16:37 ` [PATCH 43/62] drm/i915: Introduce i915_gem_active for request tracking Chris Wilson
2016-06-03 16:37 ` [PATCH 44/62] drm/i915: Prepare i915_gem_active for annotations Chris Wilson
2016-06-03 16:37 ` [PATCH 45/62] drm/i915: Mark up i915_gem_active for locking annotation Chris Wilson
2016-06-03 16:37 ` [PATCH 46/62] drm/i915: Refactor blocking waits Chris Wilson
2016-06-03 16:37 ` [PATCH 47/62] drm/i915: Rename request->list to link for consistency Chris Wilson
2016-06-03 16:37 ` [PATCH 48/62] drm/i915: Remove obsolete i915_gem_object_flush_active() Chris Wilson
2016-06-03 16:37 ` [PATCH 49/62] drm/i915: Refactor activity tracking for requests Chris Wilson
2016-06-03 16:37 ` [PATCH 50/62] drm/i915: Double check activity before relocations Chris Wilson
2016-06-03 16:37 ` [PATCH 51/62] drm/i915: Move request list retirement to i915_gem_request.c Chris Wilson
2016-06-03 16:37 ` [PATCH 52/62] drm/i915: Amalgamate GGTT/ppGTT vma debug list walkers Chris Wilson
2016-06-03 16:37 ` [PATCH 53/62] drm/i915: Split early global GTT initialisation Chris Wilson
2016-06-03 16:37 ` [PATCH 54/62] drm/i915: Store owning file on the i915_address_space Chris Wilson
2016-06-03 16:37 ` [PATCH 55/62] drm/i915: i915_vma_move_to_active prep patch Chris Wilson
2016-06-03 16:37 ` [PATCH 56/62] drm/i915: Count how many VMA are bound for an object Chris Wilson
2016-06-03 16:37 ` [PATCH 57/62] drm/i915: Be more careful when unbinding vma Chris Wilson
2016-06-03 16:37 ` [PATCH 58/62] drm/i915: Kill drop_pages() Chris Wilson
2016-06-03 16:37 ` [PATCH 59/62] drm/i915: Track active vma requests Chris Wilson
2016-06-03 16:37 ` [PATCH 60/62] drm/i915: Release vma when the handle is closed Chris Wilson
2016-06-03 16:37 ` [PATCH 61/62] drm/i915: Mark the context and address space as closed Chris Wilson
2016-06-03 16:37 ` [PATCH 62/62] Revert "drm/i915: Clean up associated VMAs on context destruction" Chris Wilson
2016-06-05 5:24 ` ✗ Ro.CI.BAT: failure for series starting with [01/62] drm/i915: Only start retire worker when idle Patchwork
2016-06-08 9:30 ` The vma leak fix from yonder Daniel Vetter
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=5758069B.2040401@linux.intel.com \
--to=arun.siluvery@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).