[PATCH] drm/ttm/nouveau: don't call tt destroy callback on alloc failure.

Christian König christian.koenig at amd.com
Wed Jul 29 12:17:13 UTC 2020


Am 29.07.20 um 02:08 schrieb Dave Airlie:
> [SNIP]
> Landed this in drm-next as well.

By the way there is another design bug in TTM which only affects 
Nouveau. See ttm_mem_io_reserve_vm() and ttm_mem_io_free_vm().


What happens is that as soon as you have an userspace VM mapping the BO 
ends up on the LRU and a flag noting that so that we don't free the VM 
reference twice.

Additional to that we have a reference count to avoid calling the 
io_mem_reserve and io_mem_free callbacks unbalanced if there are both 
userspace VM mappings and kernel mappings for CPU copies of BOs or 
kmap() etc...


But this design is complete nonsense.

What we need instead is some handling which prevents adding the io_mem 
to the LRU as soon as there are any kernel mappings, because we can't 
restore those using a fault.

I already tried to move the whole handling into Nouveau itself, so that 
we can properly fix this up there. But Ben reported that my only compile 
tested patches don't work and without hardware I can't finish them up.


Regards,
Christian.


More information about the dri-devel mailing list