Thanks Mukul.
One last thing I noticed. It seems the update the the vram_usage is
protected by the process->mutex. That means the variable will always be
coherent while that lock is held. However, the sysfs-show function
doesn't hold that lock. So if the compiler decides to break the update
into
Track GPU VRAM usage on a per process basis and report it through
sysfs.
v2:
- Handle AMDGPU BO-specific details in
amdgpu_amdkfd_gpuvm_free_memory_of_gpu().
- Return size of VRAM BO being freed from
amdgpu_amdkfd_gpuvm_free_memory_of_gpu().
- Do not consider imported memory