[Intel-gfx] [RFC 04/12] drm/i915: Use explicit flag to mark unreachable intel_context
Chris Wilson
chris at chris-wilson.co.uk
Tue Mar 10 15:30:12 UTC 2020
Quoting Tvrtko Ursulin (2020-03-09 18:31:21)
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 0893ce781a84..0302757396d5 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -2547,8 +2547,8 @@ static void eb_request_add(struct i915_execbuffer *eb)
> prev = __i915_request_commit(rq);
>
> /* Check that the context wasn't destroyed before submission */
> - if (likely(rcu_access_pointer(eb->context->gem_context))) {
> - attr = eb->gem_context->sched;
> + if (likely(!READ_ONCE(eb->context->closed))) {
> + attr = rcu_dereference(eb->gem_context)->sched;
That's the warn. We don't have a rcu_read_lock here so it complains.
eb->gem_context is a strong ref, no rcu markup require.
(it's the eb->context->gem_context that needs annotation)
-Chris
More information about the Intel-gfx
mailing list