Linux Process Management(15) > kernel thread. The interface for spawning a new kernel > thread from an existing one is: int kernel_thread (int > (*fn)(void *), void * arg, unsigned long flags) flags: > most kernel threads pass CLONE_FS CLONE_FILES > CLONE_SIGHAND > 12. P.27 Process Termination > 1. Typically, processes destruction occurs when the process > calls the exit() system call: exit() or return from main(). > 2. A process can also terminate when it receives a signal or > exception it cannot handle or ignore. > 3. do_exit() in kernel complete a number of chores(in > kernel/exit.c): > 1. Set the PF_EXITING flag in the flags member of the > task_struct. > 2. If BSD process accounting is enabled, call > acct_process() to write out accounting information. > 3. Call __exit__mm() to release the mm_struct held by