Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\rmap.c Create Date:2022-07-28 14:55:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Attach the anon_vmas from src to dst

Proto:int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)

Type:int

Parameter:

TypeParameterName
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  If Not Serialized by page_table_lock && Serialized by page_table_lock && pprev && Serialized by page_table_lock == Serialized by page_table_lock Then 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  If Value for the false possibility is greater at compile time(!avc) Then
291  unlock_anon_vma_root(root)
292  root = NULL
293  avc = anon_vma_chain_alloc(GFP_KERNEL)
294  If Not avc Then Go to 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  If Not 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 Then Serialized by page_table_lock = anon_vma
313  If Serialized by page_table_lock Then degree++
315  unlock_anon_vma_root(root)
316  Return 0
318  enomem_failure :
325  Serialized by page_table_lock = NULL
326  unlink_anon_vmas(dst)
327  Return -ENOMEM
Caller
NameDescribe
__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.