From: Chris Wilson <chris@chris-wilson.co.uk>
To: Jani Nikula <jani.nikula@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [PATCH 1/2] drm/i915: Align the hangcheck wakeup to the nearest second
Date: Fri, 05 Oct 2012 16:51:08 +0100 [thread overview]
Message-ID: <6c3329$6ip3cd@orsmga002.jf.intel.com> (raw)
In-Reply-To: <87mx01orl6.fsf@intel.com>
On Fri, 05 Oct 2012 18:40:05 +0300, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Fri, 05 Oct 2012, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > round_jiffies() aligns the wakeup time to the nearest second in order to
> > batch wakeups and reduce system load, which is useful for unimportant
> > coarse timers like our hangcheck.
> >
> > Suggested-by: Arjan van de Ven <arjan@linux.intel.com>
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Arjan van de Ven <arjan@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.h | 1 +
> > drivers/gpu/drm/i915/i915_gem.c | 3 +--
> > drivers/gpu/drm/i915/i915_irq.c | 5 ++---
> > 3 files changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index d8043af..f79c664 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -460,6 +460,7 @@ typedef struct drm_i915_private {
> >
> > /* For hangcheck timer */
> > #define DRM_I915_HANGCHECK_PERIOD 1500 /* in ms */
> > +#define DRM_I915_HANGCHECK_JIFFIES msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD)
> > struct timer_list hangcheck_timer;
> > int hangcheck_count;
> > uint32_t last_acthd[I915_NUM_RINGS];
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index c78f8e3..8e05d53 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -2151,8 +2151,7 @@ i915_add_request(struct intel_ring_buffer *ring,
> > if (!dev_priv->mm.suspended) {
> > if (i915_enable_hangcheck) {
> > mod_timer(&dev_priv->hangcheck_timer,
> > - jiffies +
> > - msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
> > + round_jiffies_relative(DRM_I915_HANGCHECK_JIFFIES));
>
> What is DRM_I915_HANGCHECK_PERIOD based on; specifically is it a strict
> minimum value? Should round_jiffies_*up*_relative() be used instead?
It's a random value plucked out of the air for being long enough that
any typical batch will have completed and short enough that the user
doesn't turn the machine off in digust. Typically we repeat the
hangcheck as well to confirm that GPU is dead before starting the error
recovery. Rounding up is slightly preferable.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
next prev parent reply other threads:[~2012-10-05 15:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-05 13:53 [PATCH 1/2] drm/i915: Align the hangcheck wakeup to the nearest second Chris Wilson
2012-10-05 13:53 ` [PATCH 2/2] drm/i915: Align the retire_requests worker " Chris Wilson
2012-10-05 15:18 ` Arjan van de Ven
2012-10-05 15:55 ` Chris Wilson
2012-10-05 16:22 ` Jani Nikula
2012-10-05 15:40 ` [PATCH 1/2] drm/i915: Align the hangcheck wakeup " Jani Nikula
2012-10-05 15:51 ` Chris Wilson [this message]
2012-10-05 16:02 ` Chris Wilson
2012-10-05 16:02 ` [PATCH 2/2] drm/i915: Align the retire_requests worker " Chris Wilson
2012-10-08 10:59 ` [PATCH 1/2] drm/i915: Align the hangcheck wakeup " Jani Nikula
2012-10-08 16:46 ` 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='6c3329$6ip3cd@orsmga002.jf.intel.com' \
--to=chris@chris-wilson.co.uk \
--cc=arjan@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
/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