]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
sh: Decouple 4k and soft/hardirq stacks.
authorPaul Mundt <lethal@linux-sh.org>
Fri, 2 Nov 2007 03:16:51 +0000 (12:16 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 2 Nov 2007 03:16:51 +0000 (12:16 +0900)
While using separate IRQ stacks can cut down on stack consumption,
many users can also use 4k stacks directly without the additional
need of separate stacks for soft and hardirqs.

With this split, we support the same rationale for 4KSTACKS as
m68knommu, with the IRQSTACKS abstraction as per ppc64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/Kconfig.debug
arch/sh/kernel/irq.c
include/asm-sh/irq.h

index b507b501f0cf2f4b24190945eb2742f8babdb261..ab2f9f3c354c27df9c54081d641c9aa11b67353d 100644 (file)
@@ -86,6 +86,14 @@ config 4KSTACKS
          on the VM subsystem for higher order allocations. This option
          will also use IRQ stacks to compensate for the reduced stackspace.
 
+config IRQSTACKS
+       bool "Use separate kernel stacks when processing interrupts"
+       depends on DEBUG_KERNEL
+       help
+         If you say Y here the kernel will use separate kernel stacks
+         for handling hard and soft interrupts.  This can help avoid
+         overflowing the process kernel stacks.
+
 config SH_KGDB
        bool "Include KGDB kernel debugger"
        select FRAME_POINTER
index 4b49d03ffbd2edd6b1598f35c58e5ab7a37d18d5..348da194ec9996617a164133ec49c9cc2a049d0a 100644 (file)
@@ -69,7 +69,7 @@ unlock:
 }
 #endif
 
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
 /*
  * per-CPU IRQ handling contexts (thread information and stack)
  */
@@ -85,7 +85,7 @@ static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly;
 asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
 {
        struct pt_regs *old_regs = set_irq_regs(regs);
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
        union irq_ctx *curctx, *irqctx;
 #endif
 
@@ -109,7 +109,7 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
 
        irq = irq_demux(evt2irq(irq));
 
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
        curctx = (union irq_ctx *)current_thread_info();
        irqctx = hardirq_ctx[smp_processor_id()];
 
@@ -157,7 +157,7 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
        return 1;
 }
 
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
 static char softirq_stack[NR_CPUS * THREAD_SIZE]
                __attribute__((__section__(".bss.page_aligned")));
 
index c61d902b8bff118d511d88fe62409a22e835e4ce..11850f65c92216d510f7b242e990ebe33b4a82ff 100644 (file)
@@ -41,7 +41,7 @@ static inline int generic_irq_demux(int irq)
 #define irq_canonicalize(irq)  (irq)
 #define irq_demux(irq)         sh_mv.mv_irq_demux(irq)
 
-#ifdef CONFIG_4KSTACKS
+#ifdef CONFIG_IRQSTACKS
 extern void irq_ctx_init(int cpu);
 extern void irq_ctx_exit(int cpu);
 # define __ARCH_HAS_DO_SOFTIRQ