Why can not processes switch in atomic context?

anish kumar anish198519851985 at gmail.com
Tue Jul 3 12:32:23 EDT 2012


On Tue, 2012-07-03 at 22:24 +0800, Parmenides wrote:
> Hi,
> 
>     It is said that kernel can not be preempted in interrupt context
> and when it is in a critical section protected by a spin lock
> 
> 1. For the spinlock case, it is easy to get if preemption is allowed
> in critical section, the purpose of protection provided by spinlock
> can not be achieved readily.
I don't know what you mean here.Please clarify.
> 
> 2. For the interrupt context case, I think when processing interrupt,
> kernel can be preempted in principle. But, this really increases the
> interrupt processing time which further cause longer response time and
> data missing in device. Except that, is there any other reasons?
data missing in device.Can you elaborate that?
Stack space is pretty limited in ISR context.Does that give you a clue?
> 
> 3. Kernel is responsible for prohibiiting passive process switches,
> namely preemption, in the above cases. But, It seems that it does not
> take care of active process swtiches, namely yield. For example, some
> code in a critical section protected by a spinlock can invoke
> schedule() to switch process passively. Is this the case?
I don't understand this question but we don't switch when we are holding
spinlock as that will jeopardize the integrity of the system i.e.
suppose you slept while holding spinlock.What would happen?
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies





More information about the Kernelnewbies mailing list