From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbdLBQw2 (ORCPT ); Sat, 2 Dec 2017 11:52:28 -0500 Received: from smtprelay0191.hostedemail.com ([216.40.44.191]:46729 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751783AbdLBQw0 (ORCPT ); Sat, 2 Dec 2017 11:52:26 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:2895:2904:3138:3139:3140:3141:3142:3352:3622:3865:3867:3870:3871:4321:4362:4605:5007:10004:10400:10450:10455:10848:11026:11232:11473:11658:11914:12043:12296:12438:12555:12740:12760:12895:13069:13095:13161:13229:13311:13357:13439:14659:14721:19904:19999:21080:21212:21433:21451:21611:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: scarf80_4f46d40458c05 X-Filterd-Recvd-Size: 2392 Message-ID: <1512233543.6321.15.camel@perches.com> Subject: Re: [PATCH] irq: Guard handle_bad_irq log messages From: Joe Perches To: Guenter Roeck , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , Dmitry Torokhov , Mika Westerberg Date: Sat, 02 Dec 2017 08:52:23 -0800 In-Reply-To: <1512232141-32275-1-git-send-email-linux@roeck-us.net> References: <1512232141-32275-1-git-send-email-linux@roeck-us.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 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 On Sat, 2017-12-02 at 08:29 -0800, Guenter Roeck wrote: > An interrupt storm on a bad interrupt will cause the kernel > log to be clogged. > > [ 60.089234] ->handle_irq(): ffffffffbe2f803f, > [ 60.090455] 0xffffffffbf2af380 > [ 60.090510] handle_bad_irq+0x0/0x2e5 > [ 60.090522] ->irq_data.chip(): ffffffffbf2af380, > [ 60.090553] IRQ_NOPROBE set > [ 60.090584] ->handle_irq(): ffffffffbe2f803f, > [ 60.090590] handle_bad_irq+0x0/0x2e5 > [ 60.090596] ->irq_data.chip(): ffffffffbf2af380, > [ 60.090602] 0xffffffffbf2af380 > [ 60.090608] ->action(): (null) > [ 60.090779] handle_bad_irq+0x0/0x2e5 > > This was seen when running an upstream kernel on Acer Chromebook R11. > The system was unstable as result. > > Guard the log message with __printk_ratelimit to reduce the impact. > This won't prevent the interrupt storm from happening, but at least > the system remains stable. Thanks. There is also dummychip.c Perhaps this should be updated in the static inline in kernel/irq/debug.h instead. > diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c [] > @@ -28,9 +28,11 @@ > */ > void handle_bad_irq(struct irq_desc *desc) > { > + static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5); > unsigned int irq = irq_desc_get_irq(desc); > > - print_irq_desc(irq, desc); > + if (__ratelimit(&ratelimit)) > + print_irq_desc(irq, desc); > kstat_incr_irqs_this_cpu(desc); > ack_bad_irq(irq); > }