Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Replication process and set stack

Proto:static struct task_struct *dup_task_struct(struct task_struct *orig, int node)

Type:struct task_struct

Parameter:

TypeParameterName
struct task_struct *orig
intnode
863  stack_vm_area((__unused__))
866  If node == NUMA_NO_NODE Then node = tsk_fork_get_node(orig)
868  tsk = Allocation memory for process
869  If Not tsk Then Return NULL
872  stack = alloc_thread_stack_node(tsk, node)
873  If Not stack Then Go to free_tsk
876  If memcg_charge_kernel_stack(tsk) Then Go to free_stack
879  stack_vm_area = task_stack_vm_area(tsk)
881  err = Copy the parent process information
888  pointer of stack = stack
896  If err Then Go to free_stack
909  setup_thread_stack(tsk, orig)
910  clear_user_return_notifier(tsk)
911  clear_tsk_need_resched(tsk)
912  set_task_stack_end_magic(tsk)
917  If cpus_ptr == cpus_mask Then cpus_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  Return tsk
952  free_stack :
953  free_thread_stack(tsk)
954  free_tsk :
955  free_task_struct(tsk)
956  Return NULL
Caller
NameDescribe
copy_processCreate a new process