[PATCH v2 2/2] drm/amdgpu: track bo memory stats at runtime
Christian König
christian.koenig at amd.com
Wed Sep 11 06:47:37 UTC 2024
Am 10.09.24 um 19:40 schrieb Li, Yunxiang (Teddy):
> [Public]
>
>> Ok that looks extremely ugly. Please just add a separate function and call that
>> from the TTM move function.
> Should I still remove the adev argument? It is never used and causes a few call sites having to find an adev unnecessarily.
When you have time then yes, but please make that a separate patch.
>> Please either drop that or compare each memory stat variable separately.
>> Byte by byte compares are really frowned upon.
> I think it's probably a good idea to check for zero here, otherwise there's no way for us to know if accounting have some bug in it. I'll change it to check each field separately (maybe break it out into a small helper so it's out of the way?)
If all fields are u64 you could do something like having an union with
fields and a dynamic sized array (e.g. u64 array[]), this way you can go
over all the fields without naming them explicitly.
And yes separate function is probably a good idea.
Christian.
>
> Teddy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20240911/8b487280/attachment.htm>
More information about the amd-gfx
mailing list