Chris Wilson <ch...@chris-wilson.co.uk> writes:

> During testing, we trigger a lot of resets on an unbannable context
> leading to massive amounts of irrelevant debug spam. Remove the
> ban_score accounting and message for the unbannable context so that we
> improve the signal:noise in the log messages for when the unexpected
> occurs.
>
> Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuopp...@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c | 23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 63308ec016a3..088579324c14 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2823,24 +2823,23 @@ i915_gem_object_pwrite_gtt(struct drm_i915_gem_object 
> *obj,
>       return 0;
>  }
>  
> -static bool ban_context(const struct i915_gem_context *ctx,
> -                     unsigned int score)
> -{
> -     return (i915_gem_context_is_bannable(ctx) &&
> -             score >= CONTEXT_SCORE_BAN_THRESHOLD);
> -}
> -
>  static void i915_gem_context_mark_guilty(struct i915_gem_context *ctx)
>  {
> -     unsigned int score;
>       bool banned;
>  
>       atomic_inc(&ctx->guilty_count);
>  
> -     score = atomic_add_return(CONTEXT_SCORE_GUILTY, &ctx->ban_score);
> -     banned = ban_context(ctx, score);
> -     DRM_DEBUG_DRIVER("context %s marked guilty (score %d) banned? %s\n",
> -                      ctx->name, score, yesno(banned));
> +     banned = false;
> +     if (i915_gem_context_is_bannable(ctx)) {
> +             unsigned int score;
> +
> +             score = atomic_add_return(CONTEXT_SCORE_GUILTY,
> +                                       &ctx->ban_score);

First I thought we should let the guilty score increment even if
context is not bannable. To be able to easily identify unbannables
causing trouble in error states.

But score zero with guilty count should be even more clear.

Reviewed-by: Mika Kuoppala <mika.kuopp...@linux.intel.com>

> +             banned = score >= CONTEXT_SCORE_BAN_THRESHOLD;
> +
> +             DRM_DEBUG_DRIVER("context %s marked guilty (score %d) banned? 
> %s\n",
> +                              ctx->name, score, yesno(banned));
> +     }
>       if (!banned)
>               return;
>  
> -- 
> 2.15.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to