Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\fork.c Create Date:2022-07-28 08:58:00
Last Modify:2020-03-17 11:04:53 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:mm_init

Proto:static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, struct user_namespace *user_ns)

Type:struct mm_struct

Parameter:

TypeParameterName
struct mm_struct *mm
struct task_struct *p
struct user_namespace *user_ns
1009  list of VMAs = NULL
1010  mm_rb =
1011  per-thread vmacache = 0
1012  atomic_set( & *@mm_users: The number of users including userspace. * Use mmget()/mmget_not_zero()/mmput() to modify. When this * drops to 0 (i.e. when the task exits and there are no other * temporary reference holders), we also release a reference on *@mm_count (which , 1)
1013  atomic_set( & *@mm_count: The number of references to &struct mm_struct * (@mm_users count as 1). * Use mmgrab()/mmdrop() to modify. When this drops to 0, the * &struct mm_struct is freed., 1)
1014  init_rwsem( & mmap_sem)
1015  Initialization list head
1016  coredumping support = NULL
1017  mm_pgtables_bytes_init(mm)
1018  number of VMAs = 0
1019  Pages that have PG_mlocked set = 0
1020  atomic64_set( & Refcount permanently increased , 0)
1021  memset( & * Special counters, in some configurations protected by the * page_table_lock, in other configurations by being atomic., 0, size of * Special counters, in some configurations protected by the * page_table_lock, in other configurations by being atomic. )
1022  Process spin lock initialization( & Protects page tables and some * counters)
1023  Process spin lock initialization( & protect the below fields )
1024  Pointer magic because the dynamic array size confuses some compilers.
1025  mm_init_aio(mm)
1026  mm_init_owner(mm, p)
1027  RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers( store ref to file /proc//exe symlink points to , NULL)
1028  mmu_notifier_mm_init(mm)
1029  init_tlb_flush_pending(mm)
1031  protected by page_table_lock = NULL
1033  mm_init_uprobes_state(mm)
1035  If mm Then
1036  Must use atomic bitops to access = flags & MMF_INIT_MASK
1037  def_flags = def_flags & This mask defines which mm->def_flags a process can inherit its parent
1038  Else
1039  Must use atomic bitops to access = default_dump_filter
1040  def_flags = 0
1043  If mm_alloc_pgd(mm) Then Go to fail_nopgd
1046  If Init a new mm. Used on mm copies, like at fork()* and on mm's that are brand-new, like at execve(). Then Go to fail_nocontext
1049  user_ns = get_user_ns(user_ns)
1050  Return mm
1052  fail_nocontext :
1053  mm_free_pgd(mm)
1054  fail_nopgd :
1055  free_mm(mm)
1056  Return NULL
Caller
NameDescribe
mm_allocAllocate and initialize an mm_struct.
dup_mmdup_mm() - duplicates an existing mm structure*@tsk: the task_struct with which the new mm will be associated.*@oldmm: the mm to duplicate.* Allocates a new mm structure and duplicates the provided @oldmm structure* content into it.