Function report |
Source Code:kernel\exit.c |
Create Date:2022-07-28 09:03:26 |
| Last Modify:2020-03-17 11:17:32 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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
Proto:static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| 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 | If Not Value is more likely to compile time(wo_flags & WEXITED) Then Return 0 |
| 986 | get_task_struct(p) |
| 987 | read_unlock( & tasklist_lock) |
| 988 | sched_annotate_sleep() |
| 989 | If wo_rusage Then getrusage(p, sys_wait4() uses this , wo_rusage) |
| 991 | put_task_struct(p) |
| 992 | Go to out_info |
| 997 | state = If ptrace_reparented(p) && thread_group_leader(p) Then EXIT_TRACE Else Used in tsk->exit_state: |
| 999 | If cmpxchg( & exit state, EXIT_ZOMBIE, state) != EXIT_ZOMBIE Then Return 0 |
| 1004 | read_unlock( & tasklist_lock) |
| 1005 | sched_annotate_sleep() |
| 1010 | If state == Used in tsk->exit_state: && thread_group_leader(p) Then |
| 1011 | sig = Signal handlers: |
| 1036 | thread_group_cputime_adjusted(p, & tgutime, & tgstime) |
| 1037 | spin_lock_irq( & siglock) |
| 1041 | cgtime += task_gtime(p) + gtime + cgtime |
| 1042 | cmin_flt += MM fault and swap info: this can arguably be seen as either mm-specific or thread-specific: + min_flt + cmin_flt |
| 1046 | cnvcsw += Context switch counts: + nvcsw + cnvcsw |
| 1050 | cinblock += task_io_get_inblock(p) + inblock + cinblock |
| 1053 | coublock += task_io_get_oublock(p) + oublock + coublock |
| 1056 | maxrss = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(maxrss, cmaxrss) |
| 1059 | task_io_accounting_add( & ioac, & ioac) |
| 1060 | task_io_accounting_add( & ioac, & ioac) |
| 1062 | spin_unlock_irq( & siglock) |
| 1065 | If wo_rusage Then getrusage(p, sys_wait4() uses this , wo_rusage) |
| 1067 | status = If Per task flags (PF_*), defined further below: & group exit in progress Then group_exit_code Else exit code |
| 1071 | If state == EXIT_TRACE Then |
| 1072 | write_lock_irq( & tasklist_lock) |
| 1074 | ptrace_unlink(p) |
| 1077 | state = EXIT_ZOMBIE |
| 1078 | If do_notify_parent(p, exit signal) Then state = Used in tsk->exit_state: |
| 1080 | exit state = state |
| 1081 | write_unlock_irq( & tasklist_lock) |
| 1083 | If state == Used in tsk->exit_state: Then release_task(p) |
| 1086 | out_info : |
| 1088 | If infop Then |
| 1089 | If (status & 0x7f) == 0 Then |
| 1090 | cause = child has exited |
| 1092 | Else |
| 1093 | cause = If status & 0x80 Then child terminated abnormally Else child was killed |
| 1100 | Return pid |
| Name | Describe |
|---|---|
| wait_consider_task | Consider @p for a wait by @parent |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |