函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\fork.c Create Date:2022-07-27 09:57:29
Last Modify:2020-03-17 11:04:53 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:设置内核内存分配器

函数原型:static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, struct user_namespace *user_ns)

返回类型:struct mm_struct

参数:

类型参数名称
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  初始化链表头
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, * Special counters, in some configurations protected by the page_table_lock, in other configurations by being atomic.的长度)
1022  spin_lock_init( & Protects page tables and some * counters)
1023  spin_lock_init( & 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  如果mm
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  否则
1039  Must use atomic bitops to access 等于default_dump_filter
1040  def_flags等于0
1043  如果mm_alloc_pgd(mm)则转到:fail_nopgd
1046  如果Init a new mm. Used on mm copies, like at fork()* and on mm's that are brand-new, like at execve().则转到:fail_nocontext
1049  user_ns等于get_user_ns(user_ns)
1050  返回:mm
1052  fail_nocontext :
1053  mm_free_pgd(mm)
1054  fail_nopgd :
1055  free_mm(mm)
1056  返回:NULL
调用者
名称描述
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.