* question about do_IRQ + 4k stacks
@ 2005-03-30 22:10 Terence Ripperda
2005-03-31 2:14 ` Brian Gerst
0 siblings, 1 reply; 3+ messages in thread
From: Terence Ripperda @ 2005-03-30 22:10 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: tripperda
I'm investigating some 4k stack issues with our driver, and I noticed
this ordering in do_IRQ:
asmlinkage unsigned int do_IRQ(struct pt_regs regs)
{
...
#ifdef CONFIG_DEBUG_STACKOVERFLOW
/* Debugging check for stack overflow: is there less than 1KB free? */
{
...
}
#endif
...
#ifdef CONFIG_4KSTACKS
for (;;) {
... switch to interrupt stack
}
#endif
Is the intention of this stack overflow check to catch a currently
running kernel thread that's getting low on stack space, or is the
intent to make sure there's enough stack space to handle the incoming
interrupt? if the later, wouldn't you want to potentially switch to
your interrupt stack to be more accurate? (I recognize that often you
will have switched to an empty stack, unless you have nested
interrupts)
Thanks,
Terence
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: question about do_IRQ + 4k stacks
2005-03-30 22:10 question about do_IRQ + 4k stacks Terence Ripperda
@ 2005-03-31 2:14 ` Brian Gerst
2005-04-01 19:09 ` Terence Ripperda
0 siblings, 1 reply; 3+ messages in thread
From: Brian Gerst @ 2005-03-31 2:14 UTC (permalink / raw)
To: Terence Ripperda; +Cc: Linux Kernel Mailing List
Terence Ripperda wrote:
> I'm investigating some 4k stack issues with our driver, and I noticed
> this ordering in do_IRQ:
>
> asmlinkage unsigned int do_IRQ(struct pt_regs regs)
> {
> ...
>
> #ifdef CONFIG_DEBUG_STACKOVERFLOW
> /* Debugging check for stack overflow: is there less than 1KB free? */
> {
> ...
> }
> #endif
>
> ...
>
> #ifdef CONFIG_4KSTACKS
>
> for (;;) {
> ... switch to interrupt stack
> }
> #endif
>
>
> Is the intention of this stack overflow check to catch a currently
> running kernel thread that's getting low on stack space, or is the
> intent to make sure there's enough stack space to handle the incoming
> interrupt? if the later, wouldn't you want to potentially switch to
> your interrupt stack to be more accurate? (I recognize that often you
> will have switched to an empty stack, unless you have nested
> interrupts)
>
It checks for both process context (system call or kernel thread) or
interrupt context (nested irqs) stack overflows.
--
Brian Gerst
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: question about do_IRQ + 4k stacks
2005-03-31 2:14 ` Brian Gerst
@ 2005-04-01 19:09 ` Terence Ripperda
0 siblings, 0 replies; 3+ messages in thread
From: Terence Ripperda @ 2005-04-01 19:09 UTC (permalink / raw)
To: Brian Gerst; +Cc: Terence Ripperda, Linux Kernel Mailing List
On Wed, Mar 30, 2005 at 09:14:22PM -0500, bgerst@didntduck.org wrote:
> It checks for both process context (system call or kernel thread) or
> interrupt context (nested irqs) stack overflows.
ok, thanks.
so we really only have 3k stacks rather than 4k stacks, right? if any
code exceeds 3k stacks and is preempted by an interrupt, we can
trigger this check and hang the system as a result (I notice that at
least RHEL 4's kernels enable this check by default, not sure about
other kernels).
Thanks,
Terence
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-04-01 19:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-30 22:10 question about do_IRQ + 4k stacks Terence Ripperda
2005-03-31 2:14 ` Brian Gerst
2005-04-01 19:09 ` Terence Ripperda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox