Hi Christian,

On top of Benjamin's note, we found a reference leak while testing this
on gfx1151 (Strix Halo, CPU page table updates for compute VMs),
backported to 6.17 together with Benjamin's "wait for tlb flush before
freeing BO".

amdgpu_vm_tlb_fence_create() now writes into &vm->last_tlb_inv. The
final "*fence = &f->base;" overwrites the previous fence without dropping
its reference, so every TLB flush leaks one fence. With the series
applied, kmalloc-128 grew by about 40 objects per process and never
leveled off. It stopped growing with:

        dma_fence_put(*fence);
        *fence = &f->base;

With this series, the page faults we saw in the rocm-examples hipThreads
examples (Libraries/hipThreads) on gfx1151 are gone. This is important for
APUs running oem kernels without dkms, hope it gets upstreamed smoothly!

Thanks,
Zichuan

Reply via email to