Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753760Ab3ISTvm (ORCPT ); Thu, 19 Sep 2013 15:51:42 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:47874 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753392Ab3ISTvU (ORCPT ); Thu, 19 Sep 2013 15:51:20 -0400 From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Frederic Weisbecker , Benjamin Herrenschmidt , Paul Mackerras , Ingo Molnar , Peter Zijlstra , "H. Peter Anvin" , Linus Torvalds , James Hogan , "James E.J. Bottomley" , Helge Deller , Martin Schwidefsky , Heiko Carstens , "David S. Miller" , Andrew Morton Subject: [PATCH 2/3] irq: Execute softirq on its own stack on irq exit Date: Thu, 19 Sep 2013 14:51:06 -0500 Message-Id: <1379620267-25191-3-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1379620267-25191-1-git-send-email-fweisbec@gmail.com> References: <1379620267-25191-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2060 Lines: 57 When a softirq executes in irq_exit(), it can contribute to random complicated and large stack scenario involving task calls, hw interrupt calls, softirq handler calls and then other irqs, interrupting the softirq, that can dig further with an irq handler. Softirqs executing on the inline hw interrupt stack may favour stack overflows in such circumstances, as it has been reported in powerpc where task -> irq -> softirq -> irq can end up forming a huge calltrace in the single kernel stack. So if there are softirqs pending on hardirq exit, lets execute them on the softirq stack to minimize this. Reported-by: Benjamin Herrenschmidt Signed-off-by: Frederic Weisbecker Tested-by: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Paul Mackerras Cc: James Hogan Cc: James E.J. Bottomley Cc: Helge Deller Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: David S. Miller Cc: Andrew Morton --- kernel/softirq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 36112cf..8c8f08b 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -326,7 +326,7 @@ void irq_enter(void) static inline void invoke_softirq(void) { if (!force_irqthreads) - __do_softirq(); + do_softirq_own_stack(); else wakeup_softirqd(); } -- 1.8.3.1 -- 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/