]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gt: Free stale request on destroying the virtual engine
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 23 Nov 2020 11:37:17 +0000 (11:37 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 24 Nov 2020 17:30:57 +0000 (09:30 -0800)
commitc271885f03432132859b14818b0e93e7de48383c
tree9b0409e8d28a004bd0c3e749a1491082bd60eadd
parent290281c369656e843f49f3b1c7e8656db32b3eae
drm/i915/gt: Free stale request on destroying the virtual engine

Since preempt-to-busy, we may unsubmit a request while it is still on
the HW and completes asynchronously. That means it may be retired and in
the process destroy the virtual engine (as the user has closed their
context), but that engine may still be holding onto the unsubmitted
compelted request. Therefore we need to potentially cleanup the old
request on destroying the virtual engine. We also have to keep the
virtual_engine alive until after the sibling's execlists_dequeue() have
finished peeking into the virtual engines, for which we serialise with
RCU.

v2: Be paranoid and flush the tasklet as well.
v3: And flush the tasklet before the engines, as the tasklet may
re-attach an rb_node after our removal from the siblings.

Fixes: 2f2ab31764ee ("drm/i915: Load balancing across a virtual engine")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201123113717.20500-4-chris@chris-wilson.co.uk
(cherry picked from commit 46eecfccb4c2b0f258adbafb2e53ca3b822cd663)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/gt/intel_lrc.c