函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:pte_alloc_one_map

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

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_fault *vmf
3293  vma等于Target VMA
3295  如果非pmd_none( * Pointer to pmd entry matching* the 'address' )则转到:map_pte
3297  如果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.
3298  Page table lock.* Protects pte page table if 'pte'* is not NULL, otherwise pmd.等于pmd_lock(The address space we belong to. , Pointer to pmd entry matching* the 'address' )
3301  转到:map_pte
3304  mm_inc_nr_ptes(The address space we belong to. )
3305  pmd_populate(The address space we belong to. , 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.)
3306  自旋锁解锁
3307  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
3308  否则如果此条件成立可能性小(为编译器优化)(pte_alloc(The address space we belong to. , Pointer to pmd entry matching* the 'address' ))则
3309  返回:VM_FAULT_OOM
3311  map_pte :
3323  如果The ordering of these checks is important for pmds with _PAGE_DEVMAP set.* If we check pmd_trans_unstable() first we will trip the bad_pmd() check* inside of pmd_none_or_trans_huge_or_clear_bad(). This will end up correctly则返回:VM_FAULT_NOPAGE
3335  Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.等于pte_offset_map_lock(The address space we belong to. , Pointer to pmd entry matching* the 'address' , Faulting virtual address , & Page table lock.* Protects pte page table if 'pte'* is not NULL, otherwise pmd.)
3337  返回:0
调用者
名称描述
alloc_set_ptealloc_set_pte - setup new PTE entry for given page and add reverse page* mapping