From patchwork Thu Aug 1 09:40:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13750097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BB22C3DA64 for ; Thu, 1 Aug 2024 09:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=YeMGwrN+psJbFK0jHKlQKrrFaM9NTr9A8dXzhAnyuhk=; b=B0pCQK7aoJFZSgF4puJ8ju7qAd EnEg6kQD1HGeOSEmgSv9jG+3hZAgKzIknSoFEAnHOLrcqk4IVOkvkb+LYa7gddaV4hHUz+UPlrciF HvST3WoiADS+O7pTx+tSsJ5XO5TLUT+OvrpvRkeA0iCYZjpaoQtzjOYcPZMktX4aPSm642PMKmWAx 4g/f9HGvRiEK0MgKYSg0gabZa92rOvzUCexM/C6FTmV05UNSlba+QBsoBRmBSC+Efa0Ihl613PDAc lINOEx1/UYsuAYyn+xnlON+DgWGEV9YU8AzlLpX1iCngx8WAnnX8/JK9HrHfNQfBNZsymsyehfRew RXJibyDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZSDK-00000004bbO-1nur; Thu, 01 Aug 2024 09:35:14 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZSCi-00000004bQe-1Qcy for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2024 09:34:38 +0000 Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WZNvr3TNKzyPSr; Thu, 1 Aug 2024 17:29:28 +0800 (CST) Received: from kwepemi100008.china.huawei.com (unknown [7.221.188.57]) by mail.maildlp.com (Postfix) with ESMTPS id D504018006C; Thu, 1 Aug 2024 17:34:27 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi100008.china.huawei.com (7.221.188.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 1 Aug 2024 17:34:27 +0800 From: Jinjie Ruan To: , , , , , , , CC: Subject: [PATCH] ARM: smp: Fix missing backtrace IPI statics Date: Thu, 1 Aug 2024 17:40:22 +0800 Message-ID: <20240801094022.1402616-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi100008.china.huawei.com (7.221.188.57) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240801_023436_776742_24723427 X-CRM114-Status: GOOD ( 14.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It is similar to ARM64 commit 916b93f4e865 ("arm64: smp: Fix missing IPI statistics"), commit 56afcd3dbd19 ("ARM: Allow IPIs to be handled as normal interrupts") set CPU_BACKTRACE IPI "IRQ_HIDDEN" flag but not show it in show_ipi_list(), which cause the interrupt kstat_irqs accounting is missing in display. Before this patch, CPU_BACKTRACE IPI is missing (QEMU vexpress-a9): # cat /proc/interrupts CPU0 24: 6 GIC-0 34 Level timer 25: 455 GIC-0 29 Level twd 26: 42 GIC-0 75 Edge virtio0 29: 8 GIC-0 44 Level kmi-pl050 30: 118 GIC-0 45 Level kmi-pl050 31: 0 GIC-0 36 Level rtc-pl031 32: 0 GIC-0 41 Level mmci-pl18x (cmd) 33: 0 GIC-0 42 Level mmci-pl18x (pio) 34: 0 GIC-0 92 Level arm-pmu 35: 0 GIC-0 93 Level arm-pmu 36: 0 GIC-0 94 Level arm-pmu 37: 0 GIC-0 95 Level arm-pmu 39: 15 GIC-0 37 Level uart-pl011 IPI0: 0 CPU wakeup interrupts IPI1: 0 Timer broadcast interrupts IPI2: 0 Rescheduling interrupts IPI3: 0 Function call interrupts IPI4: 0 CPU stop interrupts IPI5: 0 IRQ work interrupts IPI6: 0 completion interrupts Err: 0 After this pacth, CPU_BACKTRACE IPI is displayed: # cat /proc/interrupts CPU0 24: 6 GIC-0 34 Level timer 25: 687 GIC-0 29 Level twd 26: 42 GIC-0 75 Edge virtio0 29: 8 GIC-0 44 Level kmi-pl050 30: 134 GIC-0 45 Level kmi-pl050 31: 0 GIC-0 36 Level rtc-pl031 32: 0 GIC-0 41 Level mmci-pl18x (cmd) 33: 0 GIC-0 42 Level mmci-pl18x (pio) 34: 0 GIC-0 92 Level arm-pmu 35: 0 GIC-0 93 Level arm-pmu 36: 0 GIC-0 94 Level arm-pmu 37: 0 GIC-0 95 Level arm-pmu 39: 29 GIC-0 37 Level uart-pl011 IPI0: 0 CPU wakeup interrupts IPI1: 0 Timer broadcast interrupts IPI2: 0 Rescheduling interrupts IPI3: 0 Function call interrupts IPI4: 0 CPU stop interrupts IPI5: 0 IRQ work interrupts IPI6: 0 completion interrupts IPI7: 0 CPU backtrace interrupts Err: 0 Fixes: 56afcd3dbd19 ("ARM: Allow IPIs to be handled as normal interrupts") Signed-off-by: Jinjie Ruan --- arch/arm/kernel/smp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 3431c0553f45..be15cca7f8d7 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -531,7 +531,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } } -static const char *ipi_types[NR_IPI] __tracepoint_string = { +static const char *ipi_types[MAX_IPI] __tracepoint_string = { [IPI_WAKEUP] = "CPU wakeup interrupts", [IPI_TIMER] = "Timer broadcast interrupts", [IPI_RESCHEDULE] = "Rescheduling interrupts", @@ -539,6 +539,7 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = { [IPI_CPU_STOP] = "CPU stop interrupts", [IPI_IRQ_WORK] = "IRQ work interrupts", [IPI_COMPLETION] = "completion interrupts", + [IPI_CPU_BACKTRACE] = "CPU backtrace interrupts" }; static void smp_cross_call(const struct cpumask *target, unsigned int ipinr); @@ -547,7 +548,7 @@ void show_ipi_list(struct seq_file *p, int prec) { unsigned int cpu, i; - for (i = 0; i < NR_IPI; i++) { + for (i = 0; i < MAX_IPI; i++) { if (!ipi_desc[i]) continue;