Hi Steve, See my comments below. On 12/12/05, Hsieh Steve <stevecfhsieh@xxxxxxxxx> wrote: > In linux 2.4 the kernel is non-preemptive > That is, at any time, a process running in kernel mode can not be preempted > by another user process, right? I think the confusion is between Kernel is non-preemptive and kernel running on behalf of a user process ( s/m call ). I think when a user process calls a system call, then the user job is done by kernel. > Consider a user process issue a syscall, trap into kernel and when it stay > in kernel mode, the timer interrupt comes and > the process find the its own time quantum is used up(task_struct->counter > <=0) > it should be schduled out after timer interrupt complete, right? Yes. It should be pre-empted. But I think it is not that Kernel is going to be pre-empted. AFAIK, Non-Preemptive kernel applies to scheduler and other stuffs that we have read in theory. > then , if another user process scheduled to run issue a syscall, what happen? > is it allowed to trap into kernel? I saw the schedule() function. And it doesn't distinguish any process for this state. It saves the process context and loads a new process. This is what I understood from the code. I could be wrong. I welcome comments. Thanks -- vijayck -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/