From: Dave Gordon <david.s.gordon@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Display current hangcheck status in debugfs
Date: Fri, 21 Nov 2014 15:36:23 +0000 [thread overview]
Message-ID: <546F5BF7.3090007@intel.com> (raw)
In-Reply-To: <1416510790-4392-1-git-send-email-chris@chris-wilson.co.uk>
On 20/11/14 19:13, Chris Wilson wrote:
> For example,
>
> /sys/kernel/debug/dri/0/i915_hangcheck_info:
>
> Hangcheck active, fires in 15887800ms
> render ring:
> seqno = -4059 [current -583]
> action = 2
> score = 0
> ACTHD = 1ee8 [current 21f980]
> max ACTHD = 0
>
> v2: Include expiration ETA. Can anyone spot a problem?
Well, the time-until-the-hangcheck-fires in your example above looks
pretty bogus -- over 4 hours until next check seems rather unlikely, not
to say useless. The seq_printf format should be %u rather than %d, but I
don't think that's really the reason.
[[ Aside: the signatures of the jiffy-converting functions are:
unsigned int jiffies_to_msecs(const unsigned long j);
unsigned int jiffies_to_usecs(const unsigned long j);
which don't seem very sensible, as
(a) they return a possibly-smaller type than their argument, despite
probably needing a larger numeric range (if HZ <= MSEC_PER_SEC, hence
interval-in-ms is a larger number than interval-in-jiffies, and even
more so for usec), and
(b) they're defined only for non-negative quantities, whereas time
intervals can meaningfully be signed. Even if jiffies are regarded as
unsigned-ticks-since-boot, the subtraction of two unsigned quantities
yields a signed difference, requiring extra checks if you don't know
whether a certain absolute time has passed or not.
(c) 'ktime_t's are so much nicer than jiffies ]]
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 35 +++++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index f91e7f7c92af..8c8743dec20e 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1165,6 +1165,40 @@ out:
> return ret;
> }
>
> +static int i915_hangcheck_info(struct seq_file *m, void *unused)
> +{
> + struct drm_info_node *node = m->private;
> + struct drm_i915_private *dev_priv = to_i915(node->minor->dev);
> + struct intel_engine_cs *ring;
> + int i;
> +
> + if (!i915.enable_hangcheck) {
> + seq_printf(m, "Hangcheck disabled\n");
> + return 0;
> + }
> +
> + if (timer_pending(&dev_priv->gpu_error.hangcheck_timer)) {
> + seq_printf(m, "Hangcheck active, fires in %dms\n",
> + jiffies_to_msecs(dev_priv->gpu_error.hangcheck_timer.expires - jiffies));
> + } else
> + seq_printf(m, "Hangcheck inactive\n");
> +
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-21 15:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 18:54 [PATCH] drm/i915: Display current hangcheck status in debugfs Chris Wilson
2014-11-20 19:13 ` Chris Wilson
2014-11-21 15:36 ` Dave Gordon [this message]
2014-11-22 20:22 ` [PATCH] drm/i915: Display current hangcheck status in shuang.he
2014-11-22 17:12 ` shuang.he
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=546F5BF7.3090007@intel.com \
--to=david.s.gordon@intel.com \
--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