函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:We enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults)

函数原型:static vm_fault_t do_fault(struct vm_fault *vmf)

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_fault *vmf
3751  vma等于Target VMA
3752  vm_mm等于The address space we belong to.
3758  如果非fault
3763  如果此条件成立可能性小(为编译器优化)(!pmd_present( * Pointer to pmd entry matching* the 'address' ))则ret等于VM_FAULT_SIGBUS
3765  否则
3779  否则ret等于VM_FAULT_NOPAGE
3784  否则如果非FAULT_FLAG_xxx flags 按位与Fault was a write access 的值则ret等于do_read_fault(vmf)
3786  否则如果非Flags, see mm.h. 按位与VM_SHARED的值则ret等于do_cow_fault(vmf)
3788  否则ret等于do_shared_fault(vmf)
3792  如果Pre-allocated pte page table.* vm_ops->map_pages() calls* alloc_set_pte() from atomic context.* do_fault_around() pre-allocates* page table to avoid allocation from* atomic context.
3793  pte_free - free PTE-level user page table page*@mm: the mm_struct of the current context*@pte_page: the `struct page` representing the page table
3794  Pre-allocated pte page table.* vm_ops->map_pages() calls* alloc_set_pte() from atomic context.* do_fault_around() pre-allocates* page table to avoid allocation from* atomic context. = NULL
3796  返回:ret
调用者
名称描述
handle_pte_faultThese 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)