Function report |
Source Code:mm\memory.c |
Create Date:2022-07-28 14:42:05 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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.
Proto:static vm_fault_t wp_page_copy(struct vm_fault *vmf)
Type:vm_fault_t
Parameter:
Type | Parameter | Name |
---|---|---|
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 | If Value for the false possibility is greater at compile time(anon_vma_prepare(vma)) Then Go to oom |
2474 | If is_zero_pfn(pte_pfn(Value of PTE at the time of fault )) Then |
2479 | Else |
2485 | If Not cow_user_page(new_page, old_page, vmf) Then |
2499 | If mem_cgroup_try_charge_delay(new_page, mm, GFP_KERNEL, & memcg, false) Then Go to 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 | If old_page Then |
2520 | Else |
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 | If old_page Then |
2566 | page_remove_rmap(old_page, false) |
2571 | page_copied = 1 |
2572 | Else |
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 | If old_page Then |
2590 | If page_copied && Flags, see mm.h. & VM_LOCKED Then |
2592 | If PageMlocked(old_page) Then munlock_vma_page(old_page) |
2598 | Return If page_copied Then VM_FAULT_WRITE Else 0 |
2599 | oom_free_new : |
2601 | oom : |
2604 | Return VM_FAULT_OOM |
Name | Describe |
---|---|
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 |
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 |