函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-27 16:09:03
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Handle write page faults for pages that can be reused in the current vma* This can happen either due to the mapping being with the VM_SHARED flag,* or due to us being the last reference standing to the page

函数原型:static inline void wp_page_reuse(struct vm_fault *vmf)__releases(vmf->ptl)

返回类型:void

参数:

类型参数名称
struct vm_fault *vmf
2425  vma等于Target VMA
2426  page等于->fault handlers should return a* page here, unless VM_FAULT_NOPAGE* is set (which is also implied by* VM_FAULT_ERROR).
2433  如果pagepage_cpupid_xchg_last(page, (1 << LAST_CPUPID_SHIFT) - 1)
2436  flush_cache_page(vma, Faulting virtual address , pte_pfn(Value of PTE at the time of fault ))
2437  entry等于pte_mkyoung(Value of PTE at the time of fault )
2438  entry等于Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when* servicing faults for write access. In the normal case, do always want* pte_mkwrite. But get_user_pages can cause write faults for mappings
2439  如果ptep_set_access_flags(vma, Faulting virtual address , Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated., entry, 1)则The x86 doesn't have any external MMU info: the kernel page* tables contain all the necessary information.
2441  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.)
调用者
名称描述
finish_mkwrite_faultsh_mkwrite_fault - finish page fault for a shared mapping, making PTE* writeable once the page is prepared*@vmf: structure describing the fault* This function handles all that is needed to finish a write page fault in a
wp_pfn_sharedHandle write page faults for VM_MIXEDMAP or VM_PFNMAP for a VM_SHARED* mapping
wp_page_shared
do_wp_pageThis 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