Hi.... > So you mean that the code flows to call schedule() are > different when returning to user mode and the kernel mode..? Yes. Different thing needs to be done when you return to kernel space or user space To get clearer picture, please see arch/i386/kernel/entry.S beginning with the label ret_from_intr. I am not so fluent in assembly, so I also have limitation on understanding the codes. >I actually understood your previous reply in a different manner. I was > wondering " if ret_from_intr() will definitely call > ret_from_sys_call() and ret_from_sys_call() would also call > schedule(), then why all these resume_call() etc to reschedule ?" So > you mean "ret_from_intr() will call ret_from_sys_call() only when it > is returning to user mode" ? or will ret_from_intr() always call > ret_from_sys_call() ? This part, I need to apologize. I drew this conclusion simply by reading Understanding The Linux Kernel 2nd edition (which is based on 2.4.x) without actually looking on actual code. So allow me to correct them. First of all, the label ret_from_sys_call no longer exists. Seems like it is now renamed syscall_exit. Second, what I meant by "ret_from_intr calling 'ret_from_sys_call' " is, some codes are shared between them, so it's not like function A is call()-ing B and so on. These codes fragment are executed by "jmp"-ing into them. For example, try to look on entry.S and you will see that resume_userspace is "called" from both ret_from_intr and system_call. Again, "jmp <label>" is used here...not "call <function>" regards Mulyadi -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/