函数逻辑报告 |
Source Code:mm\memory.c |
Create Date:2022-07-27 16:09:11 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Handle the case of a page which we actually need to copy to a new page.* Called with mmap_sem locked and the old page referenced, but* without the ptl held.* High level logic flow:* - Allocate a page, copy the content of the old page to the new one.
函数原型:static vm_fault_t wp_page_copy(struct vm_fault *vmf)
返回类型:vm_fault_t
参数:
类型 | 参数 | 名称 |
---|---|---|
struct vm_fault * | vmf |
2462 | vma等于Target VMA |
2464 | old_page等于->fault handlers should return a* page here, unless VM_FAULT_NOPAGE* is set (which is also implied by* VM_FAULT_ERROR). |
2467 | page_copied等于0 |
2471 | 如果此条件成立可能性小(为编译器优化)(anon_vma_prepare(vma))则转到:oom |
2474 | 如果is_zero_pfn(pte_pfn(Value of PTE at the time of fault ))则 |
2479 | 否则 |
2485 | 如果非cow_user_page(new_page, old_page, vmf)则 |
2499 | 如果mem_cgroup_try_charge_delay(new_page, mm, GFP_KERNEL, & memcg, false)则转到:oom_free_new |
2502 | __SetPageUptodate(new_page) |
2504 | mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, vma, mm, Faulting virtual address & PAGE_MASK, (Faulting virtual address & PAGE_MASK) + PAGE_SIZE) |
2507 | mmu_notifier_invalidate_range_start( & range) |
2514 | 如果old_page则 |
2520 | 否则 |
2521 | inc_mm_counter_fast(mm, MM_ANONPAGES) |
2532 | ptep_clear_flush_notify(vma, Faulting virtual address , Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.) |
2533 | page_add_new_anon_rmap(new_page, vma, Faulting virtual address , false) |
2534 | mem_cgroup_commit_charge(new_page, memcg, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., false) |
2543 | 如果old_page则 |
2566 | page_remove_rmap(old_page, false) |
2571 | page_copied等于1 |
2572 | 否则 |
2573 | mem_cgroup_cancel_charge(new_page, memcg, false) |
2579 | pte_unmap_unlock(Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated., Page table lock.* Protects pte page table if 'pte'* is not NULL, otherwise pmd.) |
2585 | 如果old_page则 |
2590 | 如果page_copied且Flags, see mm.h. 按位与VM_LOCKED则 |
2592 | 如果PageMlocked(old_page)则munlock_vma_page(old_page) |
2598 | 返回:如果page_copied则VM_FAULT_WRITE否则0 |
2599 | oom_free_new : |
2601 | oom : |
2604 | 返回:VM_FAULT_OOM |
名称 | 描述 |
---|---|
do_wp_page | This routine handles present pages, when users try to write* to a shared page. It is done by copying the page to a new address* and decrementing the shared-page counter for the old page.* Note that this routine assumes that the protection checks have been |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |