[PATCH 00/19] shadow page table support V2
zhoucm1
david1.zhou at amd.com
Tue Aug 9 08:37:11 UTC 2016
On 2016年08月08日 19:04, Christian König wrote:
> Apart from that patch #1:
>> + amdgpu_ttm_placement_init(adev, &placement,
>> + placements, AMDGPU_GEM_DOMAIN_GTT,
>> + AMDGPU_GEM_CREATE_CPU_GTT_USWC);
>> +
>> + return amdgpu_bo_create_restricted(adev, size, byte_align, true,
>> + AMDGPU_GEM_DOMAIN_GTT,
>> + AMDGPU_GEM_CREATE_CPU_GTT_USWC,
>> + NULL, &placement,
>> + bo->tbo.resv,
>> + &bo->shadow);
> You need to set bo->shadow->parent to the parent BO when you use the
> reservation object here. See the VM code on how to do this, otherwise
> TTM could free the parent reservation object first and the crash when
> it wants to free the shadow.
I've tried to add parent for shadow bo, I trouble how to free shadow bo.
My old though is the life cycle of shadow bo is same as parent. That
means parent bo refers shadow bo when initialization, unref shadow bo
when BO is freeing, other people cannot refer shadow bo.
So if we set bo->shadow->parent and reference it, then the bo cannot be
freed.
Regards,
David Zhou
>
> Additional to that do we really need the placement here? That looks
> quite odd.
More information about the amd-gfx
mailing list