| Function report | 
| Source Code: mm\ksm.c | Create Date:2022-07-28 15:40:43 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:place_page - replace page in vma by new ksm page*@vma: vma that holds the pte pointing to page*@page: the page we are replacing by kpage*@kpage: the ksm page we replace page by*@orig_pte: the original value of the pte
Proto:static int replace_page(struct vm_area_struct *vma, struct page *page, struct page *kpage, pte_t orig_pte)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct vm_area_struct * | vma | |
| struct page * | page | |
| struct page * | kpage | |
| pte_t | orig_pte | 
| 1131 | addr = At what user virtual address is page expected in vma?* Caller should check the page is actually part of the vma. | 
| 1135 | pmd = mm_find_pmd(mm, addr) | 
| 1139 | mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, vma, mm, addr, addr + PAGE_SIZE) | 
| 1141 | mmu_notifier_invalidate_range_start( & range) | 
| 1145 | pte_unmap_unlock(ptep, ptl) | 
| 1146 | Go to out_mn | 
| 1153 | If Not is_zero_pfn(page_to_pfn(kpage)) Then | 
| 1157 | Else | 
| 1166 | dec_mm_counter(mm, MM_ANONPAGES) | 
| 1169 | flush_cache_page(vma, addr, pte_pfn( * ptep)) | 
| 1176 | ptep_clear_flush(vma, addr, ptep) | 
| 1184 | pte_unmap_unlock(ptep, ptl) | 
| 1185 | err = 0 | 
| 1186 | out_mn : | 
| 1187 | mmu_notifier_invalidate_range_end( & range) | 
| 1188 | out : | 
| 1189 | 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 |