How to un-insert pages inserted into a vma with vm_insert_page?
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 g开发者_运维问答ot unmapped, just that exact page range only. Which kernel function should I call?
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 call do_munmap()
directly from kernel. Look at the implementation of munmap()
system call.
精彩评论