[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regarding ISR stack
Hi,
Le Fri, 2 Feb 2007 12:15:46 +0530,
"Pharaoh ." <pharaoh137@xxxxxxxxx> a écrit :
> I have read some where recently that an ISR can have separate stack
> also i.e. an ISR need not share the stack of interrupted process.
> What I was thinking till now is, an ISR shares the stack of the
> process which was executing when the interrupt occured and ISR got
> invoked, thats why things are in fragile state when ISR is executing.
>
> My question is:
>
> Is it true that, an ISR can have seperate stack? If yes then please
> provide me pointers/link to the details. if no then why not? Won't
> life be easier if the ISR have their own stacks? I know may be this
> is not feasible on machines with less memory.
It depends on whether you have CONFIG_4KSTACKS or not.
If it's not defined, then you have 8k stacks for each thread, and the
stack of a thread is used during the execution of the ISR that
interrupted its execution.
If it's defined, then you have 4k stacks for each thread, and a
separate stack to handle the ISRs.
On i386, CONFIG_4KSTACKS doesn't seem to be the default (according to
arch/i386/defconfig).
Regarding memory consumption, 4k stacks are certainly better than 8k
stacks, see http://lwn.net/Articles/63516/. And it avoids 1-order
allocations, which can be difficult under memory pressure.
For more informations:
http://lwn.net/Articles/84583/
http://lwn.net/Articles/150580/
http://lwn.net/Articles/160138/
Sincerly,
Thomas
--
Thomas Petazzoni - thomas.petazzoni@xxxxxxxx
http://{thomas,sos,kos}.enix.org - http://www.toulibre.org
http://www.{livret,agenda}dulibre.org
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/