Function report |
Source Code:kernel\events\uprobes.c |
Create Date:2022-07-28 13:44:39 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__replace_page - replace page in vma by new page
Proto:static int __replace_page(struct vm_area_struct *vma, unsigned long addr, struct page *old_page, struct page *new_page)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct vm_area_struct * | vma | |
unsigned long | addr | |
struct page * | old_page | |
struct page * | new_page |
158 | struct page_vma_mapped_walk pvmw = {page = compound_head(old_page), vma = vma, address = addr, } |
167 | mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, vma, mm, addr, addr + PAGE_SIZE) |
170 | If new_page Then |
171 | err = mem_cgroup_try_charge(new_page, The address space we belong to. , GFP_KERNEL, & memcg, false) |
183 | If new_page Then mem_cgroup_cancel_charge(new_page, memcg, false) |
185 | Go to unlock |
187 | VM_BUG_ON_PAGE(addr != address, old_page) |
189 | If new_page Then |
191 | page_add_new_anon_rmap(new_page, vma, addr, false) |
194 | Else dec_mm_counter(mm, MM_ANONPAGES) |
200 | inc_mm_counter(mm, MM_ANONPAGES) |
203 | flush_cache_page(vma, addr, pte_pfn( * pte)) |
204 | ptep_clear_flush_notify(vma, addr, pte) |
209 | page_remove_rmap(old_page, false) |
210 | If Not page_mapped(old_page) Then try_to_free_swap(old_page) |
212 | page_vma_mapped_walk_done( & pvmw) |
214 | If Flags, see mm.h. & VM_LOCKED Then munlock_vma_page(old_page) |
218 | err = 0 |
219 | unlock : |
221 | unlock_page(old_page) |
222 | Return err |
Name | Describe |
---|---|
uprobe_write_opcode | NOTE:* Expect the breakpoint instruction to be the smallest size instruction for* the architecture |
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 |