[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about exit and task memory



Hello,
In the exit code in Linux,

     lock_kernel();
fake_volatile:
#ifdef CONFIG_BSD_PROCESS_ACCT
     acct_process(code);
#endif
     sem_exit();
     __exit_mm(tsk);
     __exit_files(tsk);
     __exit_fs(tsk);
     __exit_sighand(tsk);
     exit_thread();
     tsk->state = TASK_ZOMBIE;
     tsk->exit_code = code;
     exit_notify();
     put_exec_domain(tsk->exec_domain);
     if (tsk->binfmt && tsk->binfmt->module)
         __MOD_DEC_USE_COUNT(tsk->binfmt->module);
     schedule();


He does exit_mm(tsk) and then proceesds to perform other actions as seen above.
If the associated memory of the tsk is freed, how is the tsk able to 
continue after exit_mm?

If its another task who is the releasing , it is understandable, but here 
the active task deallocates his associated memory
as in the beginning he does
struct task_struct *tsk = current;

Is he running in a different context when he calls exit?
Thanks
--
Santosh Eraniose
-----------------------------------------------
Member Technical
Sony Software Architecture Lab
Bangalore
--
PGP Key available on request
-----------------------------------------------

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.surriel.com/kernelnewbies.shtml