Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754262Ab3IEPeD (ORCPT ); Thu, 5 Sep 2013 11:34:03 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:48428 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752612Ab3IEPde (ORCPT ); Thu, 5 Sep 2013 11:33:34 -0400 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Benjamin Herrenschmidt , Paul Mackerras , Ingo Molnar , Thomas Gleixner , 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, 5 Sep 2013 17:33:23 +0200 Message-Id: <1378395204-25342-3-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1378395204-25342-1-git-send-email-fweisbec@gmail.com> References: <1378330796.4321.50.camel@pasglop> <1378395204-25342-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: 2021 Lines: 56 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 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 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 39d27ff..657e047 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.7.5.4 -- 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/