函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_exit

函数原型:void __noreturn do_exit(long code)

返回类型:void

参数:

类型参数名称
longcode
713  tsk等于当前进程
716  profile_task_exit(tsk)
717  kcov_task_exit(tsk)
719  WARN_ON(处于睡眠态)
721  如果此条件成立可能性小(为编译器优化)(in_interrupt())则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
723  如果此条件成立可能性小(为编译器优化)(!进程ID)则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
733  set_fs(USER_DS)
735  ptrace_event - possibly stop for a ptrace event notification*@event: %PTRACE_EVENT_* value to report*@message: value for %PTRACE_GETEVENTMSG to return* Check whether @event is enabled and, if so, report @event and @message* to the ptrace parent.
737  validate_creds_for_do_exit(tsk)
743  如果此条件成立可能性小(为编译器优化)(任务标志 & Getting shut down )则
744  打印警报信息("Fixing recursive fault but reboot is needed!\n")
745  futex_exit_recursive(tsk)
746  set_current_state(深度睡眠态)
747  schedule()
750  exit_signals(tsk)
752  如果此条件成立可能性小(为编译器优化)(Are we running in atomic context? WARNING: this macro cannot* always detect atomic context; in particular, it cannot know about* held spinlocks in non-preemptible kernels. Thus it should not be())则
753  打印信息("note: %s[%d] exited with preempt_count %d\n", comm, task_pid_nr(当前进程), 抢占计数值)
756  设置抢占计数
760  如果内存信息sync_mm_rss(内存信息)
762  acct_update_integrals(tsk)
763  group_dead等于atomic_dec_and_test( & live)
764  如果group_dead
769  如果此条件成立可能性小(为编译器优化)(检查进程已初始化)则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
777  如果内存信息setmax_mm_hiwater_rss( & maxrss, 内存信息)
780  acct_collect(code, group_dead)
781  如果group_deadtty_audit_exit()
783  audit_free(tsk)
785  进程退出时发出的标号等于code
786  taskstats_exit(tsk, group_dead)
788  Turn us into a lazy TLB process if we* aren't already..
790  如果group_deadacct_process()
792  Tracepoint for a task exiting:
794  exit_sem(tsk)
795  exit_shm(tsk)
796  exit_files(tsk)
797  exit_fs(tsk)
798  如果group_deaddisassociate_ctty(1)
800  exit_task_namespaces(tsk)
801  exit_task_work(tsk)
802  Free current thread data structures etc..
803  exit_umh(tsk)
811  perf_event_exit_task(tsk)
813  sched_autogroup_exit_task(tsk)
814  cgroup_exit(tsk)
819  flush_ptrace_hw_breakpoint(tsk)
821  exit_tasks_rcu_start()
822  Send signals to all our closest relatives so that they know* to properly mourn us..
823  proc_exit_connector(tsk)
824  mpol_put_task_policy(tsk)
832  debug_check_no_locks_held()
834  如果异步I/O请求exit_io_context(tsk)
837  如果* cache last used pipe for splicefree_pipe_info(* cache last used pipe for splice)
840  如果pageput_page(page)
843  validate_creds_for_do_exit(tsk)
845  check_stack_usage()
846  禁止抢占()
847  如果赃页数__this_cpu_add(dirty_throttle_leaks, 赃页数)
849  Because preemptible RCU does not exist, tasks cannot possibly exit* while in preemptible RCU read-side critical sections.
850  exit_tasks_rcu_finish()
852  lockdep_free_task(tsk)
853  do_task_dead()
调用者
名称描述
save_v86_state
complete_and_exit
SYSCALL_DEFINE1
do_group_exitTake down every thread in the group. This is called by fatal signals* as well as by sys_exit_group (below).
call_usermodehelper_exec_asyncThis is the task which runs the usermode application
kthread
SYSCALL_DEFINE4Reboot system call: for obvious reasons only root may call it,* and even root needs to set up some magic numbers in the registers* so that some mistake won't make this reboot the whole machine.* You can also set the meaning of the ctrl-alt-del-key here.
__module_put_and_exitA thread that wants to hold a reference to a module only while it* is running can call this to safely exit. nfsd and lockd use this.
reboot_pid_ns
__secure_computing_strict
SYSCALL_DEFINE2There are no bdflush tunables left. But distributions are* still running obsolete flush daemons, so we terminate them here.* Use of bdflush() is deprecated and will be removed in a future kernel.