[Intel-gfx] [PATCH v2 4/6] drm/i915: Harden detection of missed interrupts

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 18 07:35:30 PST 2016


On Mon, Jan 18, 2016 at 03:07:16PM +0200, Mika Kuoppala wrote:
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> 
> > Only declare a missed interrupt if we find that the GPU is idle with
> > waiters and a hangcheck interval has passed in which no new user
> > interrupts have been raised.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala at intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_debugfs.c     | 11 +++++++----
> >  drivers/gpu/drm/i915/i915_irq.c         |  7 ++++++-
> >  drivers/gpu/drm/i915/intel_ringbuffer.h |  2 ++
> >  3 files changed, 15 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index b421b53ca128..966fc022418c 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -730,10 +730,10 @@ static int i915_gem_request_info(struct seq_file *m, void *data)
> >  static void i915_ring_seqno_info(struct seq_file *m,
> >  				 struct intel_engine_cs *ring)
> >  {
> > -	if (ring->get_seqno) {
> > -		seq_printf(m, "Current sequence (%s): %x\n",
> > -			   ring->name, ring->get_seqno(ring));
> > -	}
> > +	seq_printf(m, "Current sequence (%s): %x\n",
> > +		   ring->name, ring->get_seqno(ring));
> > +	seq_printf(m, "Current user interrupts (%s): %x\n",
> > +		   ring->name, READ_ONCE(ring->user_interrupts));
> >  }
> >  
> >  static int i915_gem_seqno_info(struct seq_file *m, void *data)
> > @@ -1361,6 +1361,9 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
> >  		seq_printf(m, "%s:\n", ring->name);
> >  		seq_printf(m, "\tseqno = %x [current %x]\n",
> >  			   ring->hangcheck.seqno, seqno[i]);
> > +		seq_printf(m, "\tuser interrupts = %x [current %x]\n",
> > +			   ring->hangcheck.user_interrupts,
> > +			   ring->user_interrupts);
> >  		seq_printf(m, "\tACTHD = 0x%08llx [current 0x%08llx]\n",
> >  			   (long long)ring->hangcheck.acthd,
> >  			   (long long)acthd[i]);
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index 07bc2cdd6252..978eebcf4594 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -1000,6 +1000,7 @@ static void notify_ring(struct intel_engine_cs *ring)
> >  		return;
> >  
> >  	trace_i915_gem_request_notify(ring);
> > +	ring->user_interrupts++;
> >  
> 
> For 100% accuracy we would neeb (w)mb() here?

No. Or rather there is, we don't need another one.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list