Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2996440rwb; Sat, 8 Oct 2022 19:19:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4B9KRjM8Hu8g3nAQtBhXV4rBPIiyrfn1ExrtUiT9kK8w8xE+et/tHKK8z5/1daEFJGrMvE X-Received: by 2002:a05:6402:538a:b0:457:b602:d5a6 with SMTP id ew10-20020a056402538a00b00457b602d5a6mr11356682edb.371.1665281960072; Sat, 08 Oct 2022 19:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665281960; cv=none; d=google.com; s=arc-20160816; b=jY6ctHLSFpiZROxET4brGmaMygoabwgclA3GiCg8gHQTQVmvx/CqhNe+ra4ovqm0SC e5uNA2wDcAdEQbVagCjDtoXj3w7rnMEYx/uQgV2MXqgkrG+i9RFsHtdeBeLZCeWjsuUn 3ioFHgZupyRIbUb0DJWxy90W8RIYlBZZk2InXLqMt+EYTzPu0Yia5xydNFK16jpv8GEt p7H3rodACfDnM3CYSglYqoiNbfRmdc6Gw+O4DNphjYBp25Mw1fzs8X1gJpHRt8qXG900 WfnPQqAw/4XVw+kGt5zv9JC2TwmTn3F5QsJLMbyDylWWiT9JyR2tbNbx1gTk+S07wtBa QsAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=6HuHY1nWt9lUOfGy+bfkX77ettqXzjacHcr/FU/Or6A=; b=h1wyntfPGAcWOuma4pGxelpqofyEZn932QOnw+xUANQOifN3v4EHhApYCvlZDCO2s6 ozX8E8r2zosE/F+iPpju9r43zvFw7wlQcJ2FhBQwA5E1zz9nLwVl+u1m3Xt1Hlll6n20 j9kEM+sCaPZh8mMqGD3XqqlIsHjLTdEJFpwNcxIWzUedugoJcKskL0E1CT5ec8He8Aig xAbotPCg1P28+esCTjm/f2mZR8laFcBh9jXdiJVvnhrpTjKxxZvrq59Z2ywLolvi/ATO +FWXm+akuveNGD3JR40XE8NGCMkbmij5WZpDNELmpD7dOuOMIBEwcrk1O/4SqeGvkrkC UIig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IfMej96w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a17090633c100b00741a0c28f07si5727874eja.943.2022.10.08.19.18.54; Sat, 08 Oct 2022 19:19:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IfMej96w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229773AbiJICOf (ORCPT + 99 others); Sat, 8 Oct 2022 22:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiJICOd (ORCPT ); Sat, 8 Oct 2022 22:14:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C2022B19B for ; Sat, 8 Oct 2022 19:14:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 776CD60B07 for ; Sun, 9 Oct 2022 02:14:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C50BFC433C1; Sun, 9 Oct 2022 02:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665281670; bh=dy7V4eNdrmZ4tTaUF44dYavFWUVrwzovs1/Ad2ilers=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IfMej96wgNeEnWoFEIYz4j8Eg1S+4MmdNWVVRl659cp/KSHQboDsmpWTUYbQKZq4L S3AZY0oiC1NIBH7CkYaELR89DqvSMkSfpol8U4ZhaPTYokzTPkI8g1mez240ApzFAu K3AxrH2DpAHvb5+DXV1LWVSUmjhDKxjobUlHk9WKFpImBPgXiVt8VdtF3h5rvCYz5g oahPu+qwqLjfWpxx3pbtHkZWA+3FhRdREjYwcuv7anhIreLBuJuRmuX/6hx8bXNeqB Nk8m8oVdKJHcv4p3RXtBEQch12Hpk1XVCpy0XBVBixAEPaEmATWH10kUg8P7Atdh7t UCpIxFVR+b/RA== Received: from [156.39.10.100] (helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ohLpk-00FL7T-7Q; Sun, 09 Oct 2022 03:14:28 +0100 Date: Sun, 09 Oct 2022 03:13:29 +0100 Message-ID: <87tu4dhhh2.wl-maz@kernel.org> From: Marc Zyngier To: "=?utf-8?B?WmhhbmcgWGluY2hlbmc=?=" Cc: "=?utf-8?B?dGdseA==?=" , "=?utf-8?B?bGludXgta2VybmVs?=" , "=?utf-8?B?b2xla3NhbmRy?=" , "=?utf-8?B?SGFucyBkZSBHb2VkZQ==?=" , "=?utf-8?B?YmlnZWFzeQ==?=" , "=?utf-8?B?bWFyay5ydXRsYW5k?=" , "=?utf-8?B?bWljaGFlbA==?=" Subject: Re: [PATCH] interrupt: discover and disable very frequent interrupts In-Reply-To: References: <20220930064042.14564-1-zhangxincheng@uniontech.com> <86bkqx6wrd.wl-maz@kernel.org> <868rm16tbu.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 156.39.10.100 X-SA-Exim-Rcpt-To: zhangxincheng@uniontech.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, oleksandr@natalenko.name, hdegoede@redhat.com, bigeasy@linutronix.de, mark.rutland@arm.com, michael@walle.cc X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 09 Oct 2022 02:31:36 +0100, "=?utf-8?B?WmhhbmcgWGluY2hlbmc=?=" wrote: > > > Again: what makes you think that it is better to kill the interrupt > > than suffering a RCU stall? Yes, that's a lot of interrupts. But > > killing it and risking the whole system isn't an acceptable outcome. > > It's really not good to kill interrupts directly. I'm glad you finally agree, (202210081220.9da0a329-yujie.liu@intel.com has a good example of a perfectly working machine that your patch kills for no reason). > Perhaps a better way is > to report it and let the system administrator decide what to do with it. > > + if((desc->gap_count & 0xffff0000) == 0) > + desc->gap_time = get_jiffies_64(); > + > + desc->gap_count ++; > + > + if((desc->gap_count & 0x0000ffff) >= 2000) { > + if((get_jiffies_64() - desc->gap_time) < HZ) { > + desc->gap_count += 0x00010000; > + desc->gap_count &= 0xffff0000; > + } else { > + desc->gap_count = 0; > + } > + > + if((desc->gap_count >> 16) > 30) { > + __report_bad_irq(desc, action_ret, KERN_ERR "irq %d: triggered too frequently\n"); > + } > + } > + I don't think this is much better. You hardcode values that only make sense on your HW, and for nobody else. And what can the user do with this message? Nothing at all. The message itself only contributes to problem. As it is, this patch is only a nuisance. As I said before, this would be much better as a rate-limiter, with configurable limits, and behind a debug option. M. -- Without deviation from the norm, progress is not possible.