[Intel-gfx] [PATCH 4/8] drm/i915/gt: Guard timeline pinning with its own mutex

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 15 19:43:01 UTC 2019


Quoting Matthew Auld (2019-08-15 20:19:58)
> On Wed, 14 Aug 2019 at 10:28, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> >
> > In preparation for removing struct_mutex from around context retirement,
> > we need to make timeline pinning safe. Since multiple engines/contexts
> > can share a single timeline, it needs to be protected by a mutex.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> 
> With a more accurate commit message,
> Reviewed-by: Matthew Auld <matthew.auld at intel.com>

Cruel.

In preparation for removing struct_mutex from around context retirement,
we need to make timeline pinning and unpinning safe. Since multiple
engines/contexts can share a single timeline, we cannot rely on
borrowing the context mutex (otherwise we could state that the timeline
is only pinned/unpinned inside the context pin/unpin and so guarded by
it). However, we only perform a sequence of atomic operations inside the
timeline pin/unpin and the sequence of those operations is safe for a
concurrent unpin / pin, so we can relax the struct_mutex requirement.
-Chris


More information about the Intel-gfx mailing list