nmi_count() is a historical leftover and SH is the only user. Replace it
with regular per cpu accessors.
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: [email protected]
---
arch/sh/kernel/irq.c | 2 +-
arch/sh/kernel/traps.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -44,7 +44,7 @@ int arch_show_interrupts(struct seq_file
seq_printf(p, "%*s: ", prec, "NMI");
for_each_online_cpu(j)
- seq_printf(p, "%10u ", nmi_count(j));
+ seq_printf(p, "%10u ", per_cpu(irq_stat.__nmi_count, j);
seq_printf(p, " Non-maskable interrupts\n");
seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -186,7 +186,7 @@ BUILD_TRAP_HANDLER(nmi)
arch_ftrace_nmi_enter();
nmi_enter();
- nmi_count(cpu)++;
+ this_cpu_inc(irq_stat.__nmi_count);
switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) {
case NOTIFY_OK:
The following commit has been merged into the irq/core branch of tip:
Commit-ID: fe3f1d5d7cd3062c0cb8fe70dd77470019dedd19
Gitweb: https://git.kernel.org/tip/fe3f1d5d7cd3062c0cb8fe70dd77470019dedd19
Author: Thomas Gleixner <[email protected]>
AuthorDate: Fri, 13 Nov 2020 15:02:09 +01:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Mon, 23 Nov 2020 10:31:05 +01:00
sh: Get rid of nmi_count()
nmi_count() is a historical leftover and SH is the only user. Replace it
with regular per cpu accessors.
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Frederic Weisbecker <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/sh/kernel/irq.c | 2 +-
arch/sh/kernel/traps.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 5717c7c..5addcb2 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -44,7 +44,7 @@ int arch_show_interrupts(struct seq_file *p, int prec)
seq_printf(p, "%*s: ", prec, "NMI");
for_each_online_cpu(j)
- seq_printf(p, "%10u ", nmi_count(j));
+ seq_printf(p, "%10u ", per_cpu(irq_stat.__nmi_count, j);
seq_printf(p, " Non-maskable interrupts\n");
seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 9c3d32b..f5beecd 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -186,7 +186,7 @@ BUILD_TRAP_HANDLER(nmi)
arch_ftrace_nmi_enter();
nmi_enter();
- nmi_count(cpu)++;
+ this_cpu_inc(irq_stat.__nmi_count);
switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) {
case NOTIFY_OK:
Hello Thomas!
On 11/13/20 3:02 PM, Thomas Gleixner wrote:
> nmi_count() is a historical leftover and SH is the only user. Replace it
> with regular per cpu accessors.
>
> Signed-off-by: Thomas Gleixner <[email protected]>
> Cc: Yoshinori Sato <[email protected]>
> Cc: Rich Felker <[email protected]>
> Cc: [email protected]
> ---
> arch/sh/kernel/irq.c | 2 +-
> arch/sh/kernel/traps.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> --- a/arch/sh/kernel/irq.c
> +++ b/arch/sh/kernel/irq.c
> @@ -44,7 +44,7 @@ int arch_show_interrupts(struct seq_file
>
> seq_printf(p, "%*s: ", prec, "NMI");
> for_each_online_cpu(j)
> - seq_printf(p, "%10u ", nmi_count(j));
> + seq_printf(p, "%10u ", per_cpu(irq_stat.__nmi_count, j);
> seq_printf(p, " Non-maskable interrupts\n");
>
> seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
> --- a/arch/sh/kernel/traps.c
> +++ b/arch/sh/kernel/traps.c
> @@ -186,7 +186,7 @@ BUILD_TRAP_HANDLER(nmi)
> arch_ftrace_nmi_enter();
>
> nmi_enter();
> - nmi_count(cpu)++;
> + this_cpu_inc(irq_stat.__nmi_count);
>
> switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) {
> case NOTIFY_OK:
>
Just booted my SH7785LCR board with a kernel based on Linus' latest tree
and can confirm that this change does not cause any regressions.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - [email protected]
`. `' Freie Universitaet Berlin - [email protected]
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913