函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:By the time we get here, we already hold the mm semaphore* The mmap_sem may have been released depending on flags and our* return value. See filemap_fault() and __lock_page_or_retry().

函数原型:static vm_fault_t __handle_mm_fault(struct vm_area_struct *vma, unsigned long address, unsigned int flags)

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddress
unsigned intflags
4063  struct vm_fault vmf = {Target VMA = vma, Faulting virtual address = address & PAGE_MASK, FAULT_FLAG_xxx flags = flags, Logical page offset based on vma = linear_page_index(vma, address), gfp mask to be used for allocations = __get_fault_gfp_mask(vma), }
4070  dirty等于flags按位与Fault was a write access
4071  mm等于The address space we belong to.
4076  pgd等于a shortcut to get a pgd_t in a given mm(mm, address)
4077  p4d等于The following ifdef needed to get the 5level-fixup.h header to work.* Remove it when 5level-fixup.h has been removed.
4078  如果非p4d则返回:VM_FAULT_OOM
4081  Pointer to pud entry matching* the 'address'等于pud_alloc(mm, p4d, address)
4082  如果非Pointer to pud entry matching* the 'address'则返回:VM_FAULT_OOM
4084  retry_pud :
4085  如果The "pud_xxx()" functions here are trivial for a folded two-level* setup: the pmd is never bad, and a pmd always exists (as it's folded* into the pud entry) be used on vmas which are known to support THP.* Use transparent_hugepage_enabled otherwise
4086  ret等于create_huge_pud( & vmf)
4087  如果非ret按位与VM_FAULT_FALLBACK的值则返回:ret
4089  否则
4090  orig_pud等于Pointer to pud entry matching* the 'address'
4092  The "volatile" is due to gcc bugs ()
4097  如果dirty且非pud_write(orig_pud)则
4098  ret等于wp_huge_pud( & vmf, orig_pud)
4099  如果非ret按位与VM_FAULT_FALLBACK的值则返回:ret
4101  否则
4103  返回:0
4108  Pointer to pmd entry matching* the 'address' 等于pmd_alloc(mm, Pointer to pud entry matching* the 'address', address)
4109  如果非Pointer to pmd entry matching* the 'address' 则返回:VM_FAULT_OOM
4113  如果See pmd_trans_unstable for discussion. 则转到:retry_pud
4116  如果pmd_none( * Pointer to pmd entry matching* the 'address' )且 be used on vmas which are known to support THP.* Use transparent_hugepage_enabled otherwise
4117  ret等于create_huge_pmd( & vmf)
4118  如果非ret按位与VM_FAULT_FALLBACK的值则返回:ret
4120  否则
4121  orig_pmd等于Pointer to pmd entry matching* the 'address'
4123  The "volatile" is due to gcc bugs ()
4129  返回:0
4135  如果dirty且非pmd_write(orig_pmd)则
4137  如果非ret按位与VM_FAULT_FALLBACK的值则返回:ret
4139  否则
4141  返回:0
4146  返回:These routines also need to handle stuff like marking pages dirty* and/or accessed for architectures that don't do it in hardware (most* RISC architectures)
调用者
名称描述
handle_mm_faultBy the time we get here, we already hold the mm semaphore* The mmap_sem may have been released depending on flags and our* return value. See filemap_fault() and __lock_page_or_retry().