Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Check hangcheck is functioning before indefinite waits
Date: Thu, 3 Jul 2014 09:00:45 -0700	[thread overview]
Message-ID: <20140703090045.3f2cad4f@jbarnes-desktop> (raw)
In-Reply-To: <20140703155111.GA23812@nuc-i3427.alporthouse.com>

On Thu, 3 Jul 2014 16:51:11 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:

> On Thu, Jul 03, 2014 at 08:44:20AM -0700, Jesse Barnes wrote:
> > On Thu,  3 Jul 2014 08:09:01 +0100
> > Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > 
> > > Since we rely on hangcheck to wait up and kick us out of an indefinite
> > > wait should the GPU ever stop functioning, it appears sensible that we
> > > should check that hangcheck is indeed active before starting that wait.
> > > This just prevents a driver error in the processing of hangcheck from
> > > appearing to hang the machine.
> 
> > Are there any bugs associated with this?
> 
> No open bugs. They have cropped up during dev though, and I think I am
> not alone. I believe that both Ben and I have tried to convince Daniel
> the merits of having this security blanket.
>  
> > i915_rearm_hangcheck() or something might more accurately describe
> > what's going on here.
> 
> How about i915_ensure_hangcheck()? (I agree that rearm is better than
> check.)
>  
> > I suppose both of these paths are protected by the struct_mutex?  If
> > not, might we race and mod_timer() this twice from two threads in
> > succession?  I guess that's harmless...
> 
> Concurrently arming a timer within a jiffie or two isn't going to make
> too much difference, or even pushing an almost firing timer off by
> another hangcheck interval. Conversely, since we already have read the
> hangcheck counter, if the hangcheck does fire before we schedule(), that
> will immediately wake us up and we will spot the hang.

Sounds good.  ensure_hangcheck() or update_hangcheck() are fine with me
too.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center

      reply	other threads:[~2014-07-03 16:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03  7:09 [PATCH] drm/i915: Check hangcheck is functioning before indefinite waits Chris Wilson
2014-07-03 15:44 ` Jesse Barnes
2014-07-03 15:51   ` Chris Wilson
2014-07-03 16:00     ` Jesse Barnes [this message]

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=20140703090045.3f2cad4f@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --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