函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:copy_huge_pmd

函数原型:int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, struct vm_area_struct *vma)

返回类型:int

参数:

类型参数名称
struct mm_struct *dst_mm
struct mm_struct *src_mm
pmd_t *dst_pmd
pmd_t *src_pmd
unsigned longaddr
struct vm_area_struct *vma
985  pgtable_t pgtable = NULL
986  ret等于负ENOMEM
989  如果非vma_is_anonymous(vma)则返回:0
992  pgtable等于pte_alloc_one(dst_mm)
993  如果此条件成立可能性小(为编译器优化)(!pgtable)则转到:out
996  dst_ptl等于pmd_lock(dst_mm, dst_pmd)
997  src_ptl等于pmd_lockptr(src_mm, src_pmd)
998  spin_lock_nested(src_ptl, For trivial one-depth nesting of a lock-class, the following* global define can be used. (Subsystems with multiple levels* of nesting should define their own lock-nesting subclasses.))
1000  ret等于负EAGAIN
1001  pmd等于src_pmd
1024  如果此条件成立可能性小(为编译器优化)(!pmd_trans_huge(pmd))则
1025  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
1026  转到:out_unlock
1033  如果is_huge_zero_pmd(pmd)则
1040  zero_page等于mm_get_huge_zero_page(dst_mm)
1041  Caller must hold page table lock.
1043  ret等于0
1044  转到:out_unlock
1047  src_page等于Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(pmd)
1048  VM_BUG_ON_PAGE(!PageHead(src_page), src_page)
1049  get_page(src_page)
1050  page_dup_rmap(src_page, true)
1051  add_mm_counter(dst_mm, MM_ANONPAGES, HPAGE_PMD_NR)
1052  mm_inc_nr_ptes(dst_mm)
1053  pgtable_trans_huge_deposit(dst_mm, dst_pmd, pgtable)
1055  pmdp_set_wrprotect(src_mm, addr, src_pmd)
1056  pmd等于pmd_mkold(pmd_wrprotect(pmd))
1057  set_pmd_at(dst_mm, addr, dst_pmd, pmd)
1059  ret等于0
1060  out_unlock :
1061  自旋锁解锁
1062  自旋锁解锁
1063  out :
1064  返回:ret
调用者
名称描述
copy_pmd_range