linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Julien Thierry <julien.thierry@arm.com>
To: Shijith Thotton <sthotton@marvell.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Cc: Ganapatrao Kulkarni <gkulkarni@marvell.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Jan Glauber <jglauber@marvell.com>,
	Will Deacon <will.deacon@arm.com>,
	Robert Richter <rrichter@marvell.com>,
	Jayachandran Chandrasekharan Nair <jnair@marvell.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] genirq: update irq stats from NMI handlers
Date: Thu, 4 Jul 2019 08:13:51 +0100	[thread overview]
Message-ID: <6adfb296-50f1-9efb-0840-cc8732b8ebf9@arm.com> (raw)
In-Reply-To: <1562214115-14022-1-git-send-email-sthotton@marvell.com>

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 <sthotton@marvell.com>
> ---
>  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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-07-04  7:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  4:22 [PATCH] genirq: update irq stats from NMI handlers Shijith Thotton
2019-07-04  7:13 ` Julien Thierry [this message]
2019-07-04 10:36   ` Shijith Thotton
2019-07-04 16:19     ` Thomas Gleixner
2019-07-04 16:31       ` Shijith Thotton
2019-07-05  7:56 ` [PATCH v2] " Shijith Thotton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6adfb296-50f1-9efb-0840-cc8732b8ebf9@arm.com \
    --to=julien.thierry@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=gkulkarni@marvell.com \
    --cc=jglauber@marvell.com \
    --cc=jnair@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rrichter@marvell.com \
    --cc=sthotton@marvell.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).