[Intel-gfx] [PATCH 21/66] drm/i915/gem: Asynchronous GTT unbinding

Thomas Hellström (Intel) thomas_os at shipmail.org
Fri Jul 31 13:09:06 UTC 2020


On 7/15/20 1:51 PM, Chris Wilson wrote:
> It is reasonably common for userspace (even modern drivers like iris) to
> reuse an active address for a new buffer. This would cause the
> application to stall under its mutex (originally struct_mutex) until the
> old batches were idle and it could synchronously remove the stale PTE.
> However, we can queue up a job that waits on the signal for the old
> nodes to complete and upon those signals, remove the old nodes replacing
> them with the new ones for the batch. This is still CPU driven, but in
> theory we can do the GTT patching from the GPU. The job itself has a
> completion signal allowing the execbuf to wait upon the rebinding, and
> also other observers to coordinate with the common VM activity.
>
> Letting userspace queue up more work, lets it do more stuff without
> blocking other clients. In turn, we take care not to let it too much
> concurrent work, creating a small number of queues for each context to
> limit the number of concurrent tasks.
>
> The implementation relies on only scheduling one unbind operation per
> vma as we use the unbound vma->node location to track the stale PTE.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/issues/1402
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld at intel.com>
> Cc: Andi Shyti <andi.shyti at intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom at intel.com>




More information about the Intel-gfx mailing list