How to unmap struct page from all PTEs mapping it

泪湿孤枕 提交于 2019-12-10 22:49:49

问题


I want to be able to remove a page from page cache so that next access to this page (by any process) will trigger a page fault. I'm doing this from the kernel, and I have a pointer to struct page I wish to remove. Deleting from page cache is easy (done by __delete_from_page_cache()), but I don't know how to "unmap" this page from all processes mapping it into their VMAs. I tried using try_to_unmap(my_page, cpu_page, TTU_UNMAP|TTU_IGNORE_MLOCK|TTU_IGNORE_ACCESS) from rmap.c but it doesn't seem to do what I want it to. Any help is highly appreciated. Thank you!

来源:https://stackoverflow.com/questions/49887237/how-to-unmap-struct-page-from-all-ptes-mapping-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!