Re: [PATCH] drm/i915: Differentiate between hangcheck waiting for timer or scheduler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 02, 2017 at 09:01:06PM +0000, Chris Wilson wrote:
> Check timer_pending() as well as work_pending() to see if the timer for
> the hangcheck has already expired and the work is pending execution on
> some list somewhere.
> 
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index ee4bf6f71cab..0656ccf0e0d4 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1334,11 +1334,14 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
>  
>  	intel_runtime_pm_put(dev_priv);
>  
> -	if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work)) {
> -		seq_printf(m, "Hangcheck active, fires in %dms\n",
> -			   jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires -
> -					    jiffies));
> -	} else
> +	if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work))
> +		if (timer_pending(&dev_priv->gpu_error.hangcheck_work.timer))
> +			seq_printf(m, "Hangcheck active, timer fires in %dms\n",
> +				   jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires -
> +						    jiffies));
> +		else
> +			seq_printf(m, "Hangcheck active, work pending\n");
> +	else
>  		seq_printf(m, "Hangcheck inactive\n");

For our causal debug purposes we could just

	if (timer_pending())
	else if (delayed_work_pending()) 
	else

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux