Using sys_mlock(), we're able to lock the memory buffer down, but this is not an ideal solution. What I'd like to do is create a new VMA for just the memory buffer, and then lock that VMA. Locking the VMA is what really locks the buffer.
I know the get_user_pages() returns an array of VMAs, but those VMAs most likely include other pages, and I don't want to lock any of those. So what I would like to do is create a brand new VMA, assign it to the application process, and then associate all of the pages from the memory buffer to that VMA.
Is it possible for me to do all that from within a kernel module? I've done quite a few searches, and the only way I've found to do that is with another system call, which I'm trying to avoid.
-- Timur Tabi
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/