Reputation: 6853
I would like to write a kernel function/module that will duplicate a specific page from a specific process, and then free that particular page. The module/function will then do whatever necessary to force that process into a page fault the next time it references the page.
The page fault then will be served using the duplicate that was kept aside. I can intercept page fault using the vm_operations_struct
or by modifying the handle_mm_fault
function in the kernel.
The part I am not sure how to do is freeing the page and forcing the process into a page fault.
Here is the planned test that will explain in details what I want to do:
vm_ops
pointer for that vm_area_struct
to my own vm_operations_struct
.My question is related to the step in bold.
I need to figure out how to do this. Any idea?
Thanks.
Upvotes: 2
Views: 446
Reputation: 6853
After looking into this for a while seems like try_to_unmap
is the function I am looking for.
Upvotes: 1