drm/i915: Cancel outstanding work after disabling heartbeats on an engine
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 28 Sep 2020 22:15:08 +0000 (23:15 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 29 Sep 2020 08:01:03 +0000 (09:01 +0100)
commit7a991cd3e3da9a56d5616b62d425db000a3242f2
treec5f3d117918a947242e32ea44aee022cea5034f6
parentbadef44deff1fae8d21c5c1cfc4dde95fb5bf993
drm/i915: Cancel outstanding work after disabling heartbeats on an engine

We only allow persistent requests to remain on the GPU past the closure
of their containing context (and process) so long as they are continuously
checked for hangs or allow other requests to preempt them, as we need to
ensure forward progress of the system. If we allow persistent contexts
to remain on the system after the the hangcheck mechanism is disabled,
the system may grind to a halt. On disabling the mechanism, we sent a
pulse along the engine to remove all executing contexts from the engine
which would check for hung contexts -- but we did not prevent those
contexts from being resubmitted if they survived the final hangcheck.

Fixes: 9a40bddd47ca ("drm/i915/gt: Expose heartbeat interval via sysfs")
Testcase: igt/gem_ctx_persistence/heartbeat-stop
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <stable@vger.kernel.org> # v5.7+
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200928221510.26044-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_engine.h
drivers/gpu/drm/i915/i915_request.c