Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel module doesn't clean up resources if program crashes or doesn't release handles #18

Open
enfiskutensykkel opened this issue Mar 5, 2019 · 3 comments
Assignees
Labels

Comments

@enfiskutensykkel
Copy link
Owner

No description provided.

@enfiskutensykkel
Copy link
Owner Author

Currently mappings are stored on a global linked list. We should instead keep track of open and close of the ioctl file descriptor and create a linked list per process. This would allow us to close all mappings for once process, and avoid checking the current process in lookup.

@patstew
Copy link
Contributor

patstew commented Mar 20, 2019

The other way to go about it is to use mmap to get the memory then the kernel does it for you. You still need an ioctl to get the physical address though,

@enfiskutensykkel
Copy link
Owner Author

Hmm, good point. I think the module may be up for a major overhaul, ideally it should support huge pages and allocate contiguous address ranges that it maps for the userspace program. It would simplify the logic in the library, eliminating the hard separation between the code dependent on the SISCI/SmartIO path and also make larger queues and buffers simpler to deal with by avoiding PRP lists. I will give this some thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants