On Fri, 2005-08-05 at 11:28 +0200, Thomas Petazzoni wrote: > Bhanu Kalyan Chetlapalli wrote: > > > Its not pre-emptive. But I think some ppl (esp those who use linux for > > real-time tasks) put patches to make it preemptive. > > Actually, Linux 2.6 is preemptive, and this is one of the major > improvment over 2.4. See http://lwn.net/Articles/22912/ for more > information. Background: To preempt a task in the kernel within a driver, the driver must be able to live with that at the preemption point because the very same driver may be called for completely different tasks in between. So the driver writer has to make sure that - at the preemption point - his driver continues where he left independent of the different sys-calls to the his driver for different tasks, file-descriptors, etc. So you actually *must* program that into your driver (and there is basically no way around it since it depends also on the hardware/device which your drivers is responsible for (if and) how you implement this. This may be different in different drivers.). Therefore busy-waiting is basically evil and not to be done without good reason (and even then only for a very short time - as seen in kernel speed). > However, the kernel is not fully preemptive: there are some portions of And never will be if you mean "fully preemptive" similar to "preemptive processes in the user-space" where the preemption may happen (almost) before every assembler instruction. > code during which preemption is disabled (using preempt_disable() and > preempt_enable()), and real-time people are trying to get rid of these > portions of code (or at least reduce them), in order to get the lowest > possible latencies. The real-time people use RTAI and don't really care about the rest of the Linux kernel. Or do you mean the low-latency folks? Bernd -- Firmix Software GmbH http://www.firmix.at/ mobil: +43 664 4416156 fax: +43 1 7890849-55 Embedded Linux Development and Services -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/