On Mon, 2005-12-12 at 14:18 +0800, Hsieh Steve 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? > > 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? > nope; only when the kernel returns to userspace or schedules internally will the time quantum event have a consequence. This may sound bad but you have to remember that in general the kernel has very short execution paths, so this extra "delay" isn't usually as horrific as it sounds. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/