函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Attach the anon_vmas from src to dst

函数原型:int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *dst
struct vm_area_struct *src
271  struct anon_vma * root = NULL
272  prev等于linked list of VM areas per task, sorted by address , pprev等于linked list of VM areas per task, sorted by address
281  如果非Serialized by page_table_lock Serialized by page_table_lock pprevSerialized by page_table_lock 恒等于Serialized by page_table_lock Serialized by page_table_lock 等于Serialized by page_table_lock
289  avc等于anon_vma_chain_alloc(GFP_NOWAIT | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.)
290  如果此条件成立可能性小(为编译器优化)(!avc)则
291  unlock_anon_vma_root(root)
292  root = NULL
293  avc等于anon_vma_chain_alloc(GFP_KERNEL)
294  如果非avc则转到:enomem_failure
297  anon_vma等于anon_vma
298  root等于This is a useful helper function for locking the anon_vma root as* we traverse the vma->anon_vma_chain, looping over anon_vma's that* have the same vma.* Such anon_vma's should have the same root, so you'd expect to see
299  anon_vma_chain_link(dst, avc, anon_vma)
309  如果非Serialized by page_table_lock Serialized by page_table_lock anon_vma不等于Serialized by page_table_lock Count of child anon_vmas and VMAs which points to this anon_vma.* This counter is used for making decision about reusing anon_vma* instead of forking new one. See comments in function anon_vma_clone.小于2则Serialized by page_table_lock 等于anon_vma
313  如果Serialized by page_table_lock degree自加
315  unlock_anon_vma_root(root)
316  返回:0
318  enomem_failure :
325  Serialized by page_table_lock = NULL
326  unlink_anon_vmas(dst)
327  返回:负ENOMEM
调用者
名称描述
__split_vma__split_vma() bypasses sysctl_max_map_count checking. We use this where it* has already been checked or doesn't make sense to fail.
copy_vmaCopy the vma structure to a new location in the same mm,* prior to moving page table entries, to effect an mremap move.
anon_vma_forkAttach vma to its own anon_vma, as well as to the anon_vmas that* the corresponding VMA in the parent process is attached to.* Returns 0 on success, non-zero on failure.
__vma_adjustWe cannot adjust vm_start, vm_end, vm_pgoff fields of a vma that* is already present in an i_mmap tree without adjusting the tree.* The following helper function should be used when such adjustments* are necessary