Hi everybody,

we have documented here 
https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html#dma-fence-cross-driver-contract
 that dma_fence objects must signal in a reasonable amount of time, but at the 
same time note that drivers might have a different idea of what reasonable 
means.

Recently I realized that this is actually not a good idea. Background is that 
the wall clock timeout means that for example the OOM killer might actually 
wait for this timeout to be able to terminate a process and reclaim the memory 
used. And this is just an example of how general kernel features might depend 
on that.

Some drivers and fence implementations used 10 seconds and that raised 
complains by end users. So at least amdgpu recently switched to 2 second which 
triggered an internal discussion about it.

This patch set here now adds a define to the dma_fence header which gives 2 
seconds as reasonable amount of time. SW-sync is modified to always taint the 
kernel (since it doesn't has a timeout), VGEM is switched over to the new 
define and the scheduler gets a warning and taints the kernel if a driver uses 
a timeout longer than that.

I have not much intention of actually committing the patches (maybe except the 
SW-sync one), but question is if 2 seconds are reasonable?

Regards,
Christian.

Reply via email to