I use vm_insert_page to insert a page to a userspace VMA, now I want to remove that page from that VMA. But I don’t want the whole VMA got unmapped, just that exact page range only. Which kernel function should I call?
I use vm_insert_page to insert a page to a userspace VMA, now I want
Share
You don’t need any special kernel code in order to accomplish this. All you need is for user-space to call
munmap()system call on the page that you want to unmap. Another option is to calldo_munmap()directly from kernel. Look at the implementation ofmunmap()system call.