[Intel-gfx] [PATCH v4 2/4] drm/i915: Use the vma resource as argument for gtt binding / unbinding

Thomas Hellström thomas.hellstrom at linux.intel.com
Tue Jan 4 08:29:29 UTC 2022


Hi, Oak.

On 1/4/22 00:08, Zeng, Oak wrote:
>
> Regards,
> Oak

Looks like your emails always start with "Regards, Oak". a misconfiguration?


>> -----Original Message-----
>> From: Thomas Hellström <thomas.hellstrom at linux.intel.com>
>> Sent: January 3, 2022 1:58 PM
>> To: Zeng, Oak <oak.zeng at intel.com>; intel-gfx at lists.freedesktop.org; dri-devel at lists.freedesktop.org
>> Cc: Auld, Matthew <matthew.auld at intel.com>
>> Subject: Re: [Intel-gfx] [PATCH v4 2/4] drm/i915: Use the vma resource as argument for gtt binding / unbinding
>>
>> Hi, Oak.
>>
>> On 1/3/22 19:17, Zeng, Oak wrote:
>>> Regards,
>>> Oak
>>>
>>>> -----Original Message-----
>>>> From: Intel-gfx <intel-gfx-bounces at lists.freedesktop.org> On Behalf Of Thomas Hellström
>>>> Sent: January 3, 2022 7:00 AM
>>>> To: intel-gfx at lists.freedesktop.org; dri-devel at lists.freedesktop.org
>>>> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>; Auld, Matthew <matthew.auld at intel.com>
>>>> Subject: [Intel-gfx] [PATCH v4 2/4] drm/i915: Use the vma resource as argument for gtt binding / unbinding
>>>>
>>>> When introducing asynchronous unbinding, the vma itself may no longer
>>>> be alive when the actual binding or unbinding takes place.
>>> Can we take an extra reference counter of the vma to keep the vma alive, until the actual binding/unbinding takes place?
>> The point here is that that's not needed, and should be avoided.
> Can you explain more why "keeping vma alive until unbinding takes place" should be avoided?
>
> As I understand it, your series introduce asynchronized unbinding. But since vma might be no longer alive at the time of unbinding. To overcome this difficulty, you introduce a vma resource structure and you guarantee vma resource is alive at bind/unbind time. So you can use vma resource for the bind/unbind operation. My question is, can we achieve the asynchronized unbinding still using vma structure by keeping vma structure alive ( by ref count it). This way the change should be much smaller (compared to this series). Why it is harmful to keep the vma alive? Maybe you have other reasons to introduce vma resource that I don't see.

When we allow asynchronous unbinding, it's allowed to immediately rebind 
the vma, possibly into the same gpu virtual address, but with different 
pages. And when doing that we don't want to block waiting for the unbind 
to execute. In fact, we could allow a large number of outstanding binds 
and unbinds for a vma, which makes the vma structure unsuitable to track 
this, since there will no longer be a single mapping between a set of 
active pages and a vma, or a virtual gpu range and a vma.

Thanks,

/Thomas

>
> Regards,
> Oak
>
>   If the
>> vma is no longer alive, that means nobody uses it anymore, but the GPU
>> may still have work in the pipe that references the GPU virtual address.
>>
>> /Thomas.
>>


More information about the Intel-gfx mailing list