[PATCH libdrm] amdgpu: add amdgpu_bo_handle_type_kms_noimport

Christian König ckoenig.leichtzumerken at gmail.com
Tue Jul 17 08:19:16 UTC 2018


Am 17.07.2018 um 10:03 schrieb Michel Dänzer:
> On 2018-07-17 09:59 AM, Christian König wrote:
>> Am 17.07.2018 um 09:46 schrieb Michel Dänzer:
>>> On 2018-07-17 09:33 AM, Christian König wrote:
>>>> Am 17.07.2018 um 09:26 schrieb Michel Dänzer:
>>>> [SNIP]
>>> All that should be needed is one struct list_head per BO, 16 bytes on
>>> 64-bit.
>> +malloc overhead and that for *every* BO the application/driver
>> allocated.
> The struct list_head can be stored in struct amdgpu_bo, no additional
> malloc necessary.

Well that sounds we are not talking about the same code, do we?

IIRC the hashtable implementation in libdrm is using an ever growing 
array for the BOs and *NOT* a linked list.

So we have at least two mallocs involved here, the one for the key/value 
pair and the one for the node array.

Regards,
Christian.

>
>
>> The last time I looked we could easily have a few thousands of that
>> (but not in the same CS).
>>
>> So I would guess that the wasted memory can easily be in the lower kb
>> range, compared to adding just a flag that we never going to import the
>> handle again.
> I wouldn't call the memory "wasted", as it serves a clear purpose.
>
>



More information about the amd-gfx mailing list