On 09.09.25 09:21, Thomas Hellström wrote:
>>> So what do you think about starting out with a fence, and if / when
>>> that appears not to be sufficient, we have a backup plan to move to
>>> a
>>> struct completion?
>>
>> Well we need to start somewhere, so grabbing an unsignaled dma_fence
>> reference sounds like the best plan for now.
> 
> True. A good starting point. Although I have a feeling it will turn out
> to be not fully sufficient.

Had another sleepiness night because of pain in my joints, but that got me 
another idea how to solve this.

What if the first thread who sees the BO with the zero refcount does the 
zombiefication?

In other words we grab the LRU lock and try to grab a reference to the BO, if 
that works we do our current handling.

If grabbing the BO reference doesn't work we individualize the dma_resv and 
turn the BO into a zombie by adjusting the object funcs, init the reference 
count to 1 again and eventually schedule the cleanup worker (e.g. mostly 
everything currently done in ttm_bo_release()).

As far as I can see that should work, only problem might be that we need to 
turn the LRU lock into a mutex to be able to alloc memory and sleep.

Regards,
Christian.


Reply via email to