]> 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)
commit6f316087abdaac6d16c1d63325bbc22e6d395843
tree6b55f9b8cee5a7a9502a04a604d0a207ee369fd2
parent0d863e7aa3e95add02ac01c5e9d9f4852d466bba
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: ee80fd16aa52 ("drm/i915/gem: Refine occupancy test in kill_context()")
References: 12c5a1e70d54 ("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