x86: clean up stack overflow debug check
Impact: cleanup Simplify the irq-sampled stack overflow debug check: - eliminate an #idef - use WARN_ONCE() to emit a single warning (all bets are off after the first such warning anyway) Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@@ -18,7 +18,6 @@
|
|||||||
#include <asm/idle.h>
|
#include <asm/idle.h>
|
||||||
#include <asm/smp.h>
|
#include <asm/smp.h>
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_STACKOVERFLOW
|
|
||||||
/*
|
/*
|
||||||
* Probabilistic stack overflow check:
|
* Probabilistic stack overflow check:
|
||||||
*
|
*
|
||||||
@@ -28,20 +27,18 @@
|
|||||||
*/
|
*/
|
||||||
static inline void stack_overflow_check(struct pt_regs *regs)
|
static inline void stack_overflow_check(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_DEBUG_STACKOVERFLOW
|
||||||
u64 curbase = (u64)task_stack_page(current);
|
u64 curbase = (u64)task_stack_page(current);
|
||||||
static unsigned long warned = INITIAL_JIFFIES - 60*HZ;
|
|
||||||
|
|
||||||
if (regs->sp >= curbase && regs->sp <= curbase + THREAD_SIZE &&
|
WARN_ONCE(regs->sp >= curbase &&
|
||||||
regs->sp < curbase + sizeof(struct thread_info) +
|
regs->sp <= curbase + THREAD_SIZE &&
|
||||||
sizeof(struct pt_regs) + 128 &&
|
regs->sp < curbase + sizeof(struct thread_info) +
|
||||||
time_after(jiffies, warned + 60*HZ)) {
|
sizeof(struct pt_regs) + 128,
|
||||||
printk("do_IRQ: %s near stack overflow (cur:%Lx,sp:%lx)\n",
|
|
||||||
current->comm, curbase, regs->sp);
|
"do_IRQ: %s near stack overflow (cur:%Lx,sp:%lx)\n",
|
||||||
show_stack(NULL,NULL);
|
current->comm, curbase, regs->sp);
|
||||||
warned = jiffies;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* do_IRQ handles all normal device IRQ's (the special
|
* do_IRQ handles all normal device IRQ's (the special
|
||||||
@@ -61,9 +58,7 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
|
|||||||
irq_enter();
|
irq_enter();
|
||||||
irq = __get_cpu_var(vector_irq)[vector];
|
irq = __get_cpu_var(vector_irq)[vector];
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_STACKOVERFLOW
|
|
||||||
stack_overflow_check(regs);
|
stack_overflow_check(regs);
|
||||||
#endif
|
|
||||||
|
|
||||||
desc = irq_to_desc(irq);
|
desc = irq_to_desc(irq);
|
||||||
if (likely(desc))
|
if (likely(desc))
|
||||||
|
Reference in New Issue
Block a user