函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:The mmap_sem must have been held on entry, and may have been* released depending on flags and vma->vm_ops->fault() return value.* See filemap_fault() and __lock_page_retry().

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

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_fault *vmf
3234  vma等于Target VMA
3252  如果pmd_none( * Pointer to pmd entry matching* the 'address' )且非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.
3253  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.等于pte_alloc_one(The address space we belong to. )
3254  如果非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.则返回:VM_FAULT_OOM
3256  smp_wmb()
3259  ret等于fault(vmf)
3260  如果此条件成立可能性小(为编译器优化)(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY | VM_FAULT_DONE_COW))则返回:ret
3264  如果此条件成立可能性小(为编译器优化)(PageHWPoison(->fault handlers should return a* page here, unless VM_FAULT_NOPAGE* is set (which is also implied by* VM_FAULT_ERROR).))则
3265  如果ret按位与VM_FAULT_LOCKEDlock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
3267  put_page(->fault handlers should return a* page here, unless VM_FAULT_NOPAGE* is set (which is also implied by* VM_FAULT_ERROR).)
3268  ->fault handlers should return a* page here, unless VM_FAULT_NOPAGE* is set (which is also implied by* VM_FAULT_ERROR). = NULL
3269  返回:VM_FAULT_HWPOISON
3272  如果此条件成立可能性小(为编译器优化)(!(ret & VM_FAULT_LOCKED))则lock_page may only be called if we have the page's inode pinned.
3274  否则VM_BUG_ON_PAGE(!PageLocked(->fault handlers should return a* page here, unless VM_FAULT_NOPAGE* is set (which is also implied by* VM_FAULT_ERROR).), ->fault handlers should return a* page here, unless VM_FAULT_NOPAGE* is set (which is also implied by* VM_FAULT_ERROR).)
3277  返回:ret
调用者
名称描述
do_read_fault
do_cow_fault
do_shared_fault