Hello > > Why dont we consider preemption while returning from interrupts or > > exceptions ?? > > i think we are considering this case, AFAIK you can register an > interrupt handler and specify whether this interrupt handler runs > with interrupts enabled or disabled. so we are just considering > preemption of the interrupt context just if the interrupts where > enabled while executing the interrupt handler Gaurav, maybe you can check how exception handler is called and see whether IF is cleared or set there before pushed into kernel stack. I am not sure why exception needs a condition where interrupt is masked (or disabled?). Why kernel preemption is disabled during exception? IMHO, because whenever exception arises, that means something critical happens and it needs to be handled ASAP. If interrupt is enabled to during this handler thus opening the possibility to be interleaved by other interrupt handler, there is a chance it introduces another exception that might lead to system crash Just my 2 cents idea... regards, Mulyadi -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/