OSDN Git Service

drm/i915/gem: Cancel contexts when hangchecking is disabled
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 23 Oct 2019 13:31:07 +0000 (14:31 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 23 Oct 2019 22:52:10 +0000 (23:52 +0100)
commit2e0986a58cc4f2e7f9e7ede19ec32b9c116d0068
tree8327aa406a97ada2ca9ea9795fa5bb35979e4bd8
parentd12acee84ffb07c2eb11bbb676908b3827b42598
drm/i915/gem: Cancel contexts when hangchecking is disabled

Normally, we rely on our hangcheck to prevent persistent batches from
hogging the GPU. However, if the user disables hangcheck, this mechanism
breaks down. Despite our insistence that this is unsafe, the users are
equally insistent that they want to use endless batches and will disable
the hangcheck mechanism. We are looking at replacing hangcheck, in the
next patch, with a softer mechanism, that sends a pulse down the engine
to check if it is well. We can use the same preemptive pulse to flush an
active context off the GPU upon context close, preventing resources
being lost and unkillable requests remaining on the GPU after process
termination.

Testcase: igt/gem_ctx_exec/basic-nohangcheck
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: MichaƂ Winiarski <michal.winiarski@intel.com>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Reviewed-by: Jon Bloomfield <jon.bloomfield@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191023133108.21401-4-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_context.c