函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:复制进程并设置栈

函数原型:static struct task_struct *dup_task_struct(struct task_struct *orig, int node)

返回类型:struct task_struct

参数:

类型参数名称
struct task_struct *orig
intnode
863  stack_vm_area((__unused__))
866  如果node恒等于NUMA_NO_NODEnode等于tsk_fork_get_node(orig)
868  tsk等于开辟进程内存
869  如果非tsk则返回:NULL
872  stack等于alloc_thread_stack_node(tsk, node)
873  如果非stack则转到:free_tsk
876  如果memcg_charge_kernel_stack(tsk)则转到:free_stack
879  stack_vm_area等于task_stack_vm_area(tsk)
881  err等于复制父进程信息
888  栈指针等于stack
896  如果err则转到:free_stack
909  setup_thread_stack(tsk, orig)
910  clear_user_return_notifier(tsk)
911  清除调度位
912  设置任务栈
917  如果cpus_ptr恒等于cpus_maskcpus_ptr等于cpus_mask
924  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
926  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
930  * cache last used pipe for splice = NULL
931  page = NULL
932  next = NULL
934  account_kernel_stack(tsk, 1)
936  kcov_task_init(tsk)
939  fail_nth等于0
943  throttle_queue = NULL
944  to be used once the psi infrastructure lands upstream. 等于0
948  Used by memcontrol for targeted memcg charge: = NULL
950  返回:tsk
952  free_stack :
953  free_thread_stack(tsk)
954  free_tsk :
955  free_task_struct(tsk)
956  返回:NULL
调用者
名称描述
copy_process创建进程