Re: [PATCH v2 2/2] drm/amdgpu: track bo memory stats at runtime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux