Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2826329rwb; Wed, 30 Nov 2022 11:22:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4bdIfz9OIApzICCDapEFTm6HHyASanukeL2dsNvmAqL1umeVbOaHalBFcuqa9JHqW8u84c X-Received: by 2002:a17:90a:9606:b0:213:2411:50e8 with SMTP id v6-20020a17090a960600b00213241150e8mr64967215pjo.181.1669836157368; Wed, 30 Nov 2022 11:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669836157; cv=none; d=google.com; s=arc-20160816; b=QpsumrE0iyjqKtV3QfPavMTNgjF9Y/1hGpM8S5gQmvhPlSSUPWStCDsLTRdvtXqukB oeQssa7AKlYFCq7m/XNuqE8W3RqAJiSMwnxxs+ZZ4nQGmtvwc7uPytTKsdFhaSUphg94 t7uCShRXuQ8ldPBKjbsbxQudvW23QceqiGzPkXnqGc53xlD7fCeimcijE5o8NN7eEGIq SlfggsP7twljUNRmikovmjhsUcOnzFEUNcUFJAFT9BqQMAWQUZg4HlfOua045p81Xjcx dw87lHKrzVobv10AFf+xdDAp7omCstsScLKfUeVVfV50BFdYCBCP6XRboorjth6zRpEw PimQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=b9QzyyLbalxEk2mnCmFBTHqcQvDPqhvTKb8eSHX8Vac=; b=zVyG03O0Sd71SJvNeVfqhk88cJ63c/HS2+TPQlMvwp/1myM5KaKBB3nO/nw9bO1TCk bAutT4M3+n39K3atEPwaZjb+wvkchi71a+U0IIgAmjXUctBqSSnXzPjtsJ/MGUL8vnfC T7pk35LxnfAmt+amufVnaRUFF9MVG0R9pJqFFvboShTKxM/6Lk2l/GfzeCahuH2pNWAt pMQVaF6Egd5jHLOTKpX+D0RCUsvjwM0offWF80ybbeuGyWOefNF8EfQpI6zLSQiNWVEu 68u9AFp362VN3Z7Z3LnO2bk1Z8yIwXPE+M+6t9XZt+2foEO7boVvOKXPmTB4imeFx6Q6 1cEw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a63d842000000b004785d99321bsi1982705pgj.598.2022.11.30.11.22.26; Wed, 30 Nov 2022 11:22:37 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbiK3STe (ORCPT + 83 others); Wed, 30 Nov 2022 13:19:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbiK3STO (ORCPT ); Wed, 30 Nov 2022 13:19:14 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9ADA98D64E for ; Wed, 30 Nov 2022 10:16:24 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 07E61D6E; Wed, 30 Nov 2022 10:16:31 -0800 (PST) Received: from [10.57.71.118] (unknown [10.57.71.118]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 84B0B3F73B; Wed, 30 Nov 2022 10:16:23 -0800 (PST) Message-ID: Date: Wed, 30 Nov 2022 18:16:19 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH 1/2] perf/arm-cmn: Cope with spurious IRQs better Content-Language: en-GB To: Geoff Blake Cc: will@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 2022-11-30 16:02, Geoff Blake wrote: > Robin, > > From my perspective, this is a worse solution as now we're sweeping an > issue under the rug and consuming CPU cycles handling IRQs we should not > be getting in the first place. While an overflow IRQ from the cmn should > not be high frequency, there is a non-zero chance in the future it could > be and this could lead to a very hard to debug performance issue instead > of the current problem, which is discovering we need to clean up better > from a noisy kernel message. Kexec is not the only possible source of spurious IRQs. If they cause a problem for this driver, that cannot be robustly addressed by trying to rely on whatever software might happen to run before this driver. > The driver as best I can grok currently is optimized to limit the amount > of register writes for the common use-case, which is setting and unsetting > events, so all the wiring for the PMU to feed events to the DTC is done up > front on load: DTC_CTL's DT_EN bit is set immediately during probe, as is > OVFL_INTR_EN. All the DN states and DTM PMU_CONFIG_PMU_EN is deferred > for when an event is actually set, and here we go through all of them > anyways for each event unless its bynodeid, so the expense of setting > events grows linearly with the mesh size anyways. If arm_cmn_init_dtc() writing 0 to PMCR didn't stop the PMU then we've got bigger problems, because that's how we expect to start and stop it in normal operation. I'm not ruling out that some subtle bug in that regard might exist, since I've still not yet had a chance to reproduce and observe this behaviour on my board, but I've also not seen sufficient evidence to suggest that that is the case either. (Now that I'm looking closely, I think there *is* actually a small oversight for the DTMs, but that would lead to different symptoms than you reported) At least the writes to PMOVSR_CLR *did* clearly work, because you're seeing the "nobody cared" message from the IRQ core rather than the WARN_ON(!dtc->counters[i]) which would happen if a fresh overflow was actually asserted. Currently I would expect to see up to 4 of those messages since there can be up to 4 IRQs, but once those are all requested, enabled, and "handled", all the spurious initially-latched state should be cleared and any *new* overflows will be indicated in PMOVSR. I don't see how a single IRQ could ever be unhandled more than once anyway, if the first time disables it. Thanks, Robin.