lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 4 Jul 2019 18:19:18 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Shijith Thotton <sthotton@...vell.com>
cc:     Julien Thierry <julien.thierry@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will.deacon@....com>,
        Jayachandran Chandrasekharan Nair <jnair@...vell.com>,
        Ganapatrao Kulkarni <gkulkarni@...vell.com>,
        Jan Glauber <jglauber@...vell.com>,
        Robert Richter <rrichter@...vell.com>
Subject: Re: [PATCH] genirq: update irq stats from NMI handlers

On Thu, 4 Jul 2019, Shijith Thotton wrote:
> On 7/4/19 12:13 AM, Julien Thierry wrote:
> > Looking at handle_percpu_irq(), I think this might be acceptable. But
> > does it make sense to only have kstats for percpu NMIs?
> > 
> 
> It would be better to have stats for both.
> 
> handle_fasteoi_nmi() can use __kstat_incr_irqs_this_cpu() if below 
> change can be added to kstat_irqs_cpu().
> 
> diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
> index a92b33593b8d..9484e88dabc2 100644
> --- a/kernel/irq/irqdesc.c
> +++ b/kernel/irq/irqdesc.c
> @@ -950,6 +950,11 @@ unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
>                          *per_cpu_ptr(desc->kstat_irqs, cpu) : 0;
>   }
> 
> +static bool irq_is_nmi(struct irq_desc *desc)
> +{
> +       return desc->istate & IRQS_NMI;
> +}
> +
>   /**
>    * kstat_irqs - Get the statistics for an interrupt
>    * @irq:       The interrupt number
> @@ -967,7 +972,8 @@ unsigned int kstat_irqs(unsigned int irq)
>          if (!desc || !desc->kstat_irqs)
>                  return 0;
>          if (!irq_settings_is_per_cpu_devid(desc) &&
> -           !irq_settings_is_per_cpu(desc))
> +           !irq_settings_is_per_cpu(desc) &&
> +           !irq_is_nmi(desc))
>              return desc->tot_count;
> 
>          for_each_possible_cpu(cpu)
> 
> 
> Thomas,
> Please suggest a better way if any.

Looks good.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ