]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix context ban and hang accounting for client
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Fri, 15 Jun 2018 10:44:29 +0000 (13:44 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 19 Jun 2018 12:48:16 +0000 (15:48 +0300)
commit604c574c59a75df1f915dabc78a07114d806b44c
treeeeaa442c34fbffb3793dc56333deb81ac2690c67
parentf3252e6145c4e0cd5ba0e29fc80b946b6313a621
drm/i915: Fix context ban and hang accounting for client

If client is smart or lucky enough to create a new context
after each hang, our context banning mechanism will never
catch up, and as a result of that it will be saved from
client banning. This can result in a never ending streak of
gpu hangs caused by bad or malicious client, preventing
access from other legit gpu clients.

Fix this by always incrementing per client ban score if
it hangs in short successions regardless of context ban
scoring. The exception are non bannable contexts. They remain
detached from client ban scoring mechanism.

v2: xchg timestamp, tidyup (Chris)
v3: comment, bannable & banned together (Chris)

Fixes: 9f38963e6c20 ("drm/i915: Add per client max context ban limit")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180615104429.31477-1-mika.kuoppala@linux.intel.com
(cherry picked from commit 14921f3cef85b0167a9145e5f29b9dfc3b2a84dc)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_context.c