[3/4] drm/i915: Clear hangcheck score if engine is idle

Submitted by Mika Kuoppala on Nov. 30, 2015, 4:53 p.m.

Details

Message ID 1448902389-12477-3-git-send-email-mika.kuoppala@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Mika Kuoppala Nov. 30, 2015, 4:53 p.m.
If we have accumulated hangcheck score before reaching
engine idle, that score will remain and is transferred to
the next set of batches. This is wrong as idle is a quite clear
boundary to prevent hangcheck score manipulation across batches.

Fix this by clearing the score if engine reaches idle.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 3507269..c1d1400 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3091,6 +3091,9 @@  static void i915_hangcheck_elapsed(struct work_struct *work)
 			ring->hangcheck.acthd = ring->hangcheck.max_acthd = 0;
 		}
 
+		if (!busy)
+			ring->hangcheck.score = 0;
+
 		ring->hangcheck.seqno = seqno;
 		ring->hangcheck.acthd = acthd;
 		busy_count += busy;

Comments

On Mon, Nov 30, 2015 at 06:53:08PM +0200, Mika Kuoppala wrote:
> If we have accumulated hangcheck score before reaching
> engine idle, that score will remain and is transferred to
> the next set of batches. This is wrong as idle is a quite clear
> boundary to prevent hangcheck score manipulation across batches.
> 
> Fix this by clearing the score if engine reaches idle.

The hangcheck accumulation is to detect denial of service by a
sequence of batches that each take more than a hangcheck interval, being
idle doesn't mean anything with respect to the slow dos. The only
question is whether trying to do that at all is sensible.
-Chris