Re: [PATCH] Limit irq nesting
From: KOSAKI Motohiro
Date: Wed Jul 16 2008 - 21:59:41 EST
Hi Mikulas,
> ---
> include/linux/interrupt.h | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> Index: linux-2.6.26-rc8/include/linux/interrupt.h
> ===================================================================
> --- linux-2.6.26-rc8.orig/include/linux/interrupt.h 2008-06-25 03:58:20.000000000 +0200
> +++ linux-2.6.26-rc8/include/linux/interrupt.h 2008-07-01 17:42:44.000000000 +0200
> @@ -16,6 +16,11 @@
> #include <asm/system.h>
>
> /*
> + * Max number of interrupt handlers on a stack. To prevent stack overflow.
> + */
> +#define MAX_NESTED_INTERRUPTS 2
> +
> +/*
> * These correspond to the IORESOURCE_IRQ_* defines in
> * linux/ioport.h to select the interrupt line behaviour. When
> * requesting an interrupt without specifying a IRQF_TRIGGER, the
I have no objection to your approach.
but I don't know MAX_NESTED_INTERRUPTS is properly or not.
Could you explain why MAX_NESTED_INTERRUPTS is two?
Is it architecture independent properly number?
> @@ -95,7 +100,7 @@ extern void devm_free_irq(struct device
> #ifdef CONFIG_LOCKDEP
> # define local_irq_enable_in_hardirq() do { } while (0)
> #else
> -# define local_irq_enable_in_hardirq() local_irq_enable()
> +# define local_irq_enable_in_hardirq() do { if (hardirq_count() < (MAX_NESTED_INTERRUPTS << HARDIRQ_SHIFT)) local_irq_enable(); } while (0)
> #endif
>
> extern void disable_irq_nosync(unsigned int irq);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/