]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Reduce context termination list iteration guard to RCU
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 6 Aug 2020 10:59:54 +0000 (11:59 +0100)
committerJani Nikula <jani.nikula@intel.com>
Wed, 16 Sep 2020 08:09:43 +0000 (11:09 +0300)
commite4f37e637c5bcd17c11fd378ca9ef555ab06f5bf
tree6b55f9b8cee5a7a9502a04a604d0a207ee369fd2
parent20f00e2c01e91773f33ab6a01b74d0b6ede8e00e
drm/i915/gem: Reduce context termination list iteration guard to RCU

As we now protect the timeline list using RCU, we can drop the
timeline->mutex for guarding the list iteration during context close, as
we are searching for an inflight request. Any new request will see the
context is banned and not be submitted. In doing so, pull the checks for
a concurrent submission of the request (notably the
i915_request_completed()) under the engine spinlock, to fully serialise
with __i915_request_submit()). That is in the case of preempt-to-busy
where the request may be completed during the __i915_request_submit(),
we need to be careful that we sample the request status after
serialising so that we don't miss the request the engine is actually
submitting.

Fixes: b41a07977503 ("drm/i915/gem: Refine occupancy test in kill_context()")
References: 3e751e492876 ("drm/i915: Protect i915_request_await_start from early waits") # rcu protection of timeline->requests
References: https://gitlab.freedesktop.org/drm/intel/-/issues/1622
References: https://gitlab.freedesktop.org/drm/intel/-/issues/2158
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200806105954.7766-1-chris@chris-wilson.co.uk
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
(cherry picked from commit 736e785f9b28cd9ef2d16a80960a04fd00e64b22)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/gem/i915_gem_context.c