[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: why cannot block inside interrupt context
From:       Matthias Welwarsky <mwelwarsky () web ! de>
Date:       2005-01-28 9:18:27
Message-ID: 200501281018.27418.mwelwarsky () web ! de
[Download RAW message or body]

On Friday 28 January 2005 07:37, Li Xinyi wrote:
> Chris McKillop wrote:
> > The best thing you can do is read kernel/sched.c, starting with
> > schedule() so you can better understand how the linux kernel manages
> > process.  Basically the architecture of the kernel doesn't allow for
> > interrupt handlers to sleep.  A different kernel with a different
> > architecture could certainly provide such a feature.
> >
> >     chris
>
> Hi,
>
> That is eactly what I am asking, why cannot go back to interrupt handler
> after invoking sleep inside the handler, regardless whether good or bad
> practice.

I think you're not talking about the sleep primitives in the linux kernel, 
since they're always associated with a process context. Interrupts are not 
associated with processes, so no way to use linux' "schedule()" and friends 
from there.

However, for simplicity of control flow you might want to "defer" actions in 
an interrupt handler context. All OS' I know (basically Windows and Linux) 
have a concept for that. In Windows it's called "Deferred Procedure Call", 
Linux has Tasklets or Work Queues. But they have no similarity with the 
concept you're looking for.

OK: Either you're a genius (or at least much more clever than me, which is not 
so difficult) and up to something I don't understand at all, or you should go 
and read a book about Operating System design principles. Andrew Tanenbaums 
book is an entertaining lecture ;)

regards,
	matthias


>
> Thanks,
> Li Xinyi
>
> -------------------------------------------------------------------
> Subscription options:
> http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel FAQ:      
> http://www.arm.linux.org.uk/armlinux/mlfaq.php
> Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic