Re: question about do_IRQ + 4k stacks

From: Brian Gerst (bgerst_at_didntduck.org)
Date: 03/31/05

  • Next message: Patrick Mochel: "Re: klists and struct device semaphores"
    Date:	Wed, 30 Mar 2005 21:14:22 -0500
    To: Terence Ripperda <tripperda@nvidia.com>
    
    

    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Patrick Mochel: "Re: klists and struct device semaphores"

    Relevant Pages

    • Re: Interrupt context...
      ... > gone through most of the posts on interrupt in usenet. ... > kernel stack and ISR is executed. ... More may be saved depending on the architecture. ... Here the kernel have assembler code to save all general ...
      (comp.os.linux.development.system)
    • Re: BTX on USB pen drive
      ... my pc but doesn't boot on my supermicro server. ... * Emulate MOV reg,CRx. ... * Protected Mode Hardware interrupt jump table. ... * We place a trampoline on the user stack that will return to rret_tramp ...
      (freebsd-stable)
    • Re: interrupt routine and application pages
      ... application stack in the interrupt context. ... are still in the context of interrupted thread. ... your code runs at raised IRQL, Memory Manager just had no chance to ...
      (microsoft.public.development.device.drivers)
    • [PATCH 4/6] UML - IRQ stacks
      ... Add a separate IRQ stack. ... interrupt run on a separate stack rather than starting on the normal ... The IRQ stack for CPU 0 is declared in the same way as the initial ... handler can't run because it has no idea what shape the stack is in. ...
      (Linux-Kernel)
    • Re: Question about interrupt in MINIX3
      ... a new stack for use during the interrupt service. ... stack is determined by an entry in the Task State Segment. ... does interrupt service just use five last entries in stackframe as its stack? ...
      (comp.os.minix)