From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752121AbdLBRLj (ORCPT ); Sat, 2 Dec 2017 12:11:39 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:40434 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751848AbdLBRLf (ORCPT ); Sat, 2 Dec 2017 12:11:35 -0500 X-Google-Smtp-Source: AGs4zMaR112j4r8c4uQyefQ2OBRp9Ti/jXL8dwXrT+8IbOIWQfGB4F35R6e4r4j3bGK+NG6M/vPIZw== Subject: Re: [PATCH] irq: Guard handle_bad_irq log messages To: Joe Perches , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , Dmitry Torokhov , Mika Westerberg References: <1512232141-32275-1-git-send-email-linux@roeck-us.net> <1512233543.6321.15.camel@perches.com> From: Guenter Roeck Message-ID: Date: Sat, 2 Dec 2017 09:11:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1512233543.6321.15.camel@perches.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/02/2017 08:52 AM, Joe Perches wrote: > 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. > Agreed, makes sense. I'll send an updated patch. Guenter >> 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); >> } >