函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\exit.c Create Date:2022-07-27 10:03:08
Last Modify:2020-03-17 11:17:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Handle sys_wait4 work for one task in state EXIT_ZOMBIE. We hold* read_lock(&tasklist_lock) on entry. If we return zero, we still hold* the lock and this task is uninteresting. If we return nonzero, we have

函数原型:static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)

返回类型:int

参数:

类型参数名称
struct wait_opts *wo
struct task_struct *p
977  pid等于task_pid_vnr(p)
978  uid等于from_kuid_munged(current_user_ns(), task_uid(p))
981  如果非此条件成立可能性大(为编译器优化)(wo_flags & WEXITED)则返回:0
984  如果此条件成立可能性小(为编译器优化)(wo_flags & Don't reap, just poll status. )则
985  status等于进程退出时发出的标号
986  get_task_struct(p)
987  read_unlock( & tasklist_lock)
988  sched_annotate_sleep()
989  如果wo_rusagegetrusage(p, sys_wait4() uses this , wo_rusage)
991  put_task_struct(p)
992  转到:out_info
997  state等于如果ptrace_reparented(p)且thread_group_leader(p)则EXIT_TRACE否则Used in tsk->exit_state:
999  如果cmpxchg( & 进程退出时状态, EXIT_ZOMBIE, state)不等于EXIT_ZOMBIE则返回:0
1004  read_unlock( & tasklist_lock)
1005  sched_annotate_sleep()
1010  如果state恒等于Used in tsk->exit_state: thread_group_leader(p)则
1011  sig等于信号
1012  psig等于signal
1036  thread_group_cputime_adjusted(p, & tgutime, & tgstime)
1037  spin_lock_irq( & siglock)
1038  当前CPU负责更新时间
1039  cutime加等于tgutimecutime
1040  cstime加等于tgstimecstime
1041  cgtime加等于task_gtime(p)加gtimecgtime
1042  cmin_flt加等于换页信息min_fltcmin_flt
1044  cmaj_flt加等于换页信息maj_fltcmaj_flt
1046  cnvcsw加等于切换计数nvcswcnvcsw
1048  cnivcsw加等于上下文切换计数nivcswcnivcsw
1050  cinblock加等于task_io_get_inblock(p)加inblockcinblock
1053  coublock加等于task_io_get_oublock(p)加oublockcoublock
1056  maxrss等于两数取大(maxrss, cmaxrss)
1057  如果cmaxrss小于maxrsscmaxrss等于maxrss
1059  task_io_accounting_add( & ioac, & ioac)
1060  task_io_accounting_add( & ioac, & ioac)
1061  write_sequnlock( & Cumulative resource counters for dead threads in the group,* and for reaped dead child processes forked by this group.* Live threads maintain their own counters and add to these* in __exit_signal, except for the group leader.)
1062  spin_unlock_irq( & siglock)
1065  如果wo_rusagegetrusage(p, sys_wait4() uses this , wo_rusage)
1067  status等于如果任务标志按位与group exit in progress group_exit_code否则进程退出时发出的标号
1069  wo_stat等于status
1071  如果state恒等于EXIT_TRACE
1072  write_lock_irq( & tasklist_lock)
1074  ptrace_unlink(p)
1077  state等于EXIT_ZOMBIE
1078  如果do_notify_parent(p, 进程退出时发出的信号)则state等于Used in tsk->exit_state:
1080  进程退出时状态等于state
1081  write_unlock_irq( & tasklist_lock)
1083  如果state恒等于Used in tsk->exit_state: release_task(p)
1086  out_info :
1087  infop等于wo_info
1088  如果infop
1089  如果status按位与0x7f的值恒等于0则
1091  status等于status右移8位
1092  否则
1093  cause等于如果status按位与0x80则child terminated abnormally 否则child was killed
1094  status等于status按位与0x7f
1096  pid等于pid
1097  uid等于uid
1100  返回:pid
调用者
名称描述
wait_consider_taskConsider @p for a wait by @parent