     .   ,  -
  ,      do_exit (), 
   .

   PF_EXITING   flags  task_struct.

   del_timer_sync () ,     .
     ,    
      .

      ,  
(BSD process accounting),    acct_process ()  
   ,   .

   _exit_mm()    mm_struct,
 .         -
 ( ,   ),    -
.

   exit_sem ().      -
     IPC,     
   .

    exit_files () ,_exit_fs (), exit_namespace () 
exit signals ()      ,  -
  ,    , 
    .    -
   ,  ,   
      .

    ,     exit_code
 task_struct.       -
 exit ()     , -   -
.

   exit_notify (),    -
        -
 (reparent)      ,
    -      -
 ,   in it.   -
    TASK_ZOMBIE.

   schedule ()      (. -
 4, "  ").    
TASK_ZOMBIE     ,    -
,    .

   do_exit ()    kernel/exit. .
     ,   (  -
   ).      (, 
    ,     ),  -
 ,   TASK_ZOMBIE.   , 
  ,        , -
   thread_info  task_struct.

60                                                                             3