函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_fault_around() tries to map few pages around the fault address. The hope* is that the pages will be needed soon and this will lower the number of* faults to handle.* It uses vm_ops->map_pages() to map the pages, which skips the page if it's

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

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_fault *vmf
3587  address等于Faulting virtual address
3588  start_pgoff等于Logical page offset based on vma
3591  ret等于0
3593  nr_pages等于READ_ONCE(fault_around_bytes)右移PAGE_SHIFT determines the page size
3594  mask等于nr_pagesPAGE_SIZE减1的差的反按位与PAGE_MASK
3596  Faulting virtual address 等于两数取大(address & mask, Our start address within vm_mm. )
3597  off等于addressFaulting virtual address 右移PAGE_SHIFT determines the page size 位按位与he i386 is two-level, so we don't really have any* PMD directory physically.减1
3598  start_pgoff减等于off
3604  end_pgoff等于start_pgoffFaulting virtual address 右移PAGE_SHIFT determines the page size 位按位与he i386 is two-level, so we don't really have any* PMD directory physically.减1的值加he i386 is two-level, so we don't really have any* PMD directory physically.减1
3607  end_pgoff等于三数取小(end_pgoff, vma_pages(Target VMA ) + Offset (within vm_file) in PAGE_SIZEunits - 1, start_pgoff + nr_pages - 1)
3610  如果pmd_none( * Pointer to pmd entry matching* the 'address' )则
3611  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. )
3612  如果非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.则转到:out
3614  smp_wmb()
3617  map_pages(vmf, start_pgoff, end_pgoff)
3620  如果pmd_trans_huge( * Pointer to pmd entry matching* the 'address' )则
3621  ret等于VM_FAULT_NOPAGE
3622  转到:out
3626  如果非Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.则转到:out
3630  Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.减等于Faulting virtual address 右移PAGE_SHIFT determines the page size 位的值减address右移PAGE_SHIFT determines the page size 位的值
3631  如果非pte_none( * Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.)则ret等于VM_FAULT_NOPAGE
3633  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.)
3634  out :
3635  Faulting virtual address 等于address
3636  Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated. = NULL
3637  返回:ret
调用者
名称描述
do_read_fault