[PATCH 4/5] drm/ttm: initialize globals during device init

Christian König ckoenig.leichtzumerken at gmail.com
Mon Oct 22 12:35:33 UTC 2018


Am 22.10.18 um 08:45 schrieb Zhang, Jerry(Junwei):
> A question in ttm_bo.c
> [SNIP]
>>     int ttm_bo_device_release(struct ttm_bo_device *bdev)
>>   {
>> @@ -1623,18 +1620,25 @@ int ttm_bo_device_release(struct 
>> ttm_bo_device *bdev)
>> drm_vma_offset_manager_destroy(&bdev->vma_manager);
>>   +    if (!ret)
>> +        ttm_bo_global_release();
>
> if ttm_bo_clean_mm() fails, it will skip ttm_bo_global_release().
> When will it be called?

Never.

>
> Shall add it to delayed work? or maybe we could release it directly?

No, when ttm_bo_device_release() fails somebody is trying to unload a 
driver while this driver still has memory allocated.

In this case BO accounting should not be released because we should make 
sure that all the leaked memory is still accounted.

Christian.

>
> Regards,
> Jerry



More information about the amd-gfx mailing list