ikwzm / udmabuf

User space mappable dma buffer device driver for Linux.
BSD 2-Clause "Simplified" License
560 stars 168 forks source link

Delete on abnormal termination. #61

Closed ldalessa closed 4 years ago

ldalessa commented 4 years ago

I'd like to be able to have buffers deleted up on termination. Normal atexit/on_exit is fine for normal termination, but abnormal termination is much more complex, requiring signal chaining or some form of extra-process monitoring.

I'm not familiar with the kernel internals. Is this functionality that the u-dma-buf driver could support through flags during create? Would it require some sort of daemon, or could it append the buffers as resources that are already cleaned up by the kernel?

ikwzm commented 4 years ago

Thank you for the issue.

With u-dma-buf, buffers can only be created/deleted by adding/deleting device tree or by using u-dma-buf-mgr. I wasn't thinking of removing it automatically when the user application was closed. If you want to remove it automatically, you will need a daemon.

ldalessa commented 4 years ago

Okay, thanks. I didn't know if there was atexit kernel equivalents that you could already hook up to that I don't have access to in user-space. Oh well.