Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752061Ab3IUVrK (ORCPT ); Sat, 21 Sep 2013 17:47:10 -0400 Received: from gate.crashing.org ([63.228.1.57]:36333 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751712Ab3IUVrI (ORCPT ); Sat, 21 Sep 2013 17:47:08 -0400 Message-ID: <1379799901.24090.6.camel@pasglop> Subject: Re: [RFC GIT PULL] softirq: Consolidation and stack overrun fix From: Benjamin Herrenschmidt To: Frederic Weisbecker Cc: Linus Torvalds , Thomas Gleixner , LKML , Paul Mackerras , Ingo Molnar , Peter Zijlstra , "H. Peter Anvin" , James Hogan , "James E.J. Bottomley" , Helge Deller , Martin Schwidefsky , Heiko Carstens , "David S. Miller" , Andrew Morton Date: Sun, 22 Sep 2013 07:45:01 +1000 In-Reply-To: References: <1379620267-25191-1-git-send-email-fweisbec@gmail.com> <20130920162603.GA30381@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1971 Lines: 47 On Sat, 2013-09-21 at 13:58 -0500, Frederic Weisbecker wrote: > Now certainly what needs to be fixed then is archs that don't have > __ARCH_IRQ_EXIT_IRQS_DISABLED > or archs that have any other significant opportunity to nest interrupt. Interesting. I notice we don't define it on powerpc but we don't enable IRQs in do_IRQ either... our path is very similar to x86 in this regard, the only thing that can cause them to become enabled would be if a driver interrupt handler did local_irq_enable(). It used to be fairly common for drivers to do spin_unlock_irq() which would unconditionally re-enable. Did we add WARNs or lockdep logic to catch these nowadays ? > > - process context doing local_bh_enable, and a bh became pending > > while it was disabled. See above: this needs a stack switch. Which > > stack to use is open, again assuming that a hardirq coming in will > > switch to yet another stack. > > Right. Now if we do like Thomas suggested, we can have a common irq > stack that is big enough for hard and softirqs. After all there should > never be more than two or three nesting irq contexts: > hardirq->softirq->hardirq, softirq->hardirq, ... > > At least if we put aside the unsane archs that can nest irqs somehow. I really don't like the "larger" irq stack ... probably because I can't make it work easily :-) See my previous comment about how we get to thread_info on ppc. What I *can* do that would help I suppose would be to switch to the irq stack before irq_enter/exit which would at least mean that softirq would run from the top of the irq stack which is better than the current situation. I'm fact I'll whip up a quick fix see if that might be enough of a band aid for RHEL7. Cheers, Ben. -- 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/