Function report |
Source Code:mm\ksm.c |
Create Date:2022-07-28 15:40:38 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:write_protect_page
Proto:static int write_protect_page(struct vm_area_struct *vma, struct page *page, pte_t *orig_pte)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct vm_area_struct * | vma | |
| struct page * | page | |
| pte_t * | orig_pte |
| 1044 | address = At what user virtual address is page expected in vma?* Caller should check the page is actually part of the vma. |
| 1048 | BUG_ON(PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved.) |
| 1050 | mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, vma, mm, address, address + PAGE_SIZE) |
| 1053 | mmu_notifier_invalidate_range_start( & range) |
| 1057 | If WARN_ONCE(!pte, "Unexpected PMD mapping?") Then Go to out_unlock |
| 1065 | swapped = PageSwapCache(page) |
| 1066 | flush_cache_page(vma, address, page_to_pfn(page)) |
| 1081 | entry = ptep_clear_flush(vma, address, pte) |
| 1086 | If page_mapcount(page) + 1 + swapped != page_count(page) Then |
| 1087 | set_pte_at(mm, address, pte, entry) |
| 1088 | Go to out_unlock |
| 1090 | If The following only work if pte_present() is true.* Undefined behaviour if not.. Then Dirty a page |
| 1095 | Else entry = pte_mkclean(pte_wrprotect(entry)) |
| 1100 | err = 0 |
| 1102 | out_unlock : |
| 1103 | page_vma_mapped_walk_done( & pvmw) |
| 1104 | out_mn : |
| 1105 | mmu_notifier_invalidate_range_end( & range) |
| 1106 | out : |
| 1107 | Return err |
| Name | Describe |
|---|---|
| try_to_merge_one_page | ry_to_merge_one_page - take two pages and merge them into one*@vma: the vma that holds the pte pointing to page*@page: the PageAnon page that we want to replace with kpage*@kpage: the PageKsm page that we want to map instead of page, |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |