Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1830031ybi; Thu, 4 Jul 2019 00:15:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgWWTSGUovVb15tBpKgx+0InsU7vU+EVbNaH6Ob/+3U8xXpcTZdydAY5YpNlKgQ5IpbF4Z X-Received: by 2002:a17:90a:d80b:: with SMTP id a11mr17115488pjv.53.1562224500540; Thu, 04 Jul 2019 00:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562224500; cv=none; d=google.com; s=arc-20160816; b=z+GjJrpmFRAop2inX4EAkNEq2SYaKY6ulNRpJBDg3uAU/G/XPGBRX/FgygjhEK/DJI 4iq8SsrgIt915BZhaHyG3LkCqRklgYKGI6El/zvfmsRVnykxrU3YCCYbqx8OLl7ObUPh Lhy1IcYCALf0bohXtzxDSz8hOLAn7tJ24B/lxnKQirXSTm5AaFMGhU/cVmURlZWqhfTh zMznoP3wo177FRi5gsIrKFjCikhHfk+G3olSFenuW0u5PFcZFvFVLXVsQfbf6UWtlidK 8TuP7y7JrkmIs/7T0idfpHBX87FprzmCGQppzCbgjqAo181odWJZL3UFoUN3qHsy7rWO RtTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=yYXJ1SDUZ5inPjrWwQrbTp5hVQxbFDPB2OAP20N/Gy4=; b=mxoU0QhEMF+DNFST8T95zW0nTeyQR9+jA5nTG5aZERxCjWV5Pzcj9h5n7R4zBwFHxl Io/5Twz+XofMtE+y0opvTgD0bTXtX87eqlH0n34QA/o3PhHhujao3aNxpe+qSxjHUfUd hyb+Lh24F974FHjzMMDdEj0C7INn2nphM+QG9Zpa+/jiCH/c0JWVtEIOL7N5l2UXNR7R Z8V13eDi4glB0kl3lnWz2kSs38o+jrETi5LHBNZ7N8RuFFAKApHWeUjHzsLBaruJQLk+ 721ynfWd0hd8rX9LGi1J73z/Od9YC0B/mvHqcVrBvq1+O8Yju0Jezmi9Cf0UvlpQzj0D nQcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si4786230pgw.101.2019.07.04.00.14.45; Thu, 04 Jul 2019 00:15:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727326AbfGDHNz (ORCPT + 99 others); Thu, 4 Jul 2019 03:13:55 -0400 Received: from foss.arm.com ([217.140.110.172]:35324 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbfGDHNz (ORCPT ); Thu, 4 Jul 2019 03:13:55 -0400 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 419DE344; Thu, 4 Jul 2019 00:13:54 -0700 (PDT) Received: from [10.1.197.45] (e112298-lin.cambridge.arm.com [10.1.197.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7B5063F703; Thu, 4 Jul 2019 00:15:46 -0700 (PDT) Subject: Re: [PATCH] genirq: update irq stats from NMI handlers To: Shijith Thotton , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Cc: Thomas Gleixner , Catalin Marinas , Will Deacon , Jayachandran Chandrasekharan Nair , Ganapatrao Kulkarni , Jan Glauber , Robert Richter References: <1562214115-14022-1-git-send-email-sthotton@marvell.com> From: Julien Thierry Message-ID: <6adfb296-50f1-9efb-0840-cc8732b8ebf9@arm.com> Date: Thu, 4 Jul 2019 08:13:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1562214115-14022-1-git-send-email-sthotton@marvell.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shijith, On 04/07/2019 05:22, Shijith Thotton wrote: > The NMI handlers handle_percpu_devid_fasteoi_nmi() and > handle_fasteoi_nmi() added by commit 2dcf1fbcad35 ("genirq: Provide NMI > handlers") do not update the interrupt counts. Due to that the NMI > interrupt count does not show up correctly in /proc/interrupts. > > Update the functions to fix this. With this change, we can see stats of > the perf NMI interrupts on arm64. > > Fixes: 2dcf1fbcad35 ("genirq: Provide NMI handlers") > > Signed-off-by: Shijith Thotton > --- > kernel/irq/chip.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c > index 29d6c7d070b4..88d1e054c6ea 100644 > --- a/kernel/irq/chip.c > +++ b/kernel/irq/chip.c > @@ -748,6 +748,8 @@ void handle_fasteoi_nmi(struct irq_desc *desc) > unsigned int irq = irq_desc_get_irq(desc); > irqreturn_t res; > > + kstat_incr_irqs_this_cpu(desc); > + This needs to be called with the desc lock taken, otherwise we're likely to corrupt desc->tot_count. But taking the desc lock is something we can't do in NMI context ( *spin_lock_irq*() won't prevent an NMI from happening). > trace_irq_handler_entry(irq, action); > /* > * NMIs cannot be shared, there is only one action. > @@ -962,6 +964,8 @@ void handle_percpu_devid_fasteoi_nmi(struct irq_desc *desc) > unsigned int irq = irq_desc_get_irq(desc); > irqreturn_t res; > > + __kstat_incr_irqs_this_cpu(desc); > + Looking at handle_percpu_irq(), I think this might be acceptable. But does it make sense to only have kstats for percpu NMIs? Cheers, -- Julien Thierry