函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:alloc_set_pte - setup new PTE entry for given page and add reverse page* mapping

函数原型:vm_fault_t alloc_set_pte(struct vm_fault *vmf, struct mem_cgroup *memcg, struct page *page)

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_fault *vmf
struct mem_cgroup *memcg
struct page *page
3437  vma等于Target VMA
3438  write等于FAULT_FLAG_xxx flags 按位与Fault was a write access
3442  如果pmd_none( * Pointer to pmd entry matching* the 'address' )且PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved.IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_TRANSPARENT_HUGE_PAGECACHE)则
3445  VM_BUG_ON_PAGE(memcg, page)
3447  ret等于do_set_pmd(vmf, page)
3448  如果ret不等于VM_FAULT_FALLBACK则返回:ret
3452  如果非Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.
3453  ret等于pte_alloc_one_map(vmf)
3454  如果ret则返回:ret
3459  如果此条件成立可能性小(为编译器优化)(!pte_none( * Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.))则返回:VM_FAULT_NOPAGE
3462  flush_icache_page(vma, page)
3463  entry等于Conversion functions: convert a page and protection to a page entry,* and a page entry and page directory to the page they refer to.* (Currently stuck as a macro because of indirect forward reference* to linux/mm.h:page_to_nid())(page, Access permissions of this VMA. )
3464  如果writeentry等于Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when* servicing faults for write access. In the normal case, do always want* pte_mkwrite. But get_user_pages can cause write faults for mappings
3467  如果write且非Flags, see mm.h. 按位与VM_SHARED的值则
3468  inc_mm_counter_fast(The address space we belong to. , MM_ANONPAGES)
3469  page_add_new_anon_rmap(page, vma, Faulting virtual address , false)
3470  mem_cgroup_commit_charge(page, memcg, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., false)
3471  lru_cache_add_active_or_unevictable*@page: the page to be added to LRU*@vma: vma in which page is mapped for determining reclaimability* Place @page on the active or unevictable LRU list, depending on its* evictability
3472  否则
3473  inc_mm_counter_fast(The address space we belong to. , Optimized variant when page is already known not to be PageAnon )
3474  page_add_file_rmap - add pte mapping to a file page*@page: the page to add the mapping to*@compound: charge the page as compound or small page* The caller needs to hold the pte lock.
3476  set_pte_at(The address space we belong to. , Faulting virtual address , Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated., entry)
3479  The x86 doesn't have any external MMU info: the kernel page* tables contain all the necessary information.
3481  返回:0
调用者
名称描述
finish_faultsh_fault - finish page fault once we have prepared the page to fault*@vmf: structure describing the fault* This function handles all that is needed to finish a page fault once the* page to fault in is prepared
filemap_map_pages