sparc64: Use a seperate counter for timer interrupts and NMI checks, like x86.

Previous thread: sparc64: Remove profiling from some low-level bits. by Linux Kernel Mailing List on Tuesday, April 13, 2010 - 12:59 pm. (1 message)

Next thread: sparc64: Add HAVE_FUNCTION_TRACE_MCOUNT_TEST and tidy up. by Linux Kernel Mailing List on Tuesday, April 13, 2010 - 12:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Tuesday, April 13, 2010 - 12:59 pm

Gitweb:     http://git.kernel.org/linus/daecbf58a509bc27c112647e825df763c3e3b0f4
Commit:     daecbf58a509bc27c112647e825df763c3e3b0f4
Parent:     f8e8a8e8cba3359df2a16c17d59eedb08adf3b43
Author:     David S. Miller <davem@davemloft.net>
AuthorDate: Tue Apr 6 17:38:52 2010 -0700
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Mon Apr 12 22:37:07 2010 -0700

    sparc64: Use a seperate counter for timer interrupts and NMI checks, like x86.
    
    This keeps us from having to use kstat_irqs_cpu() from the NMI handler,
    the former of which is a profiled function.
    
    Instead we use a currently empty slot in the cpu_data
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/include/asm/cpudata_64.h |    2 +-
 arch/sparc/kernel/nmi.c             |    3 +--
 arch/sparc/kernel/time_64.c         |    1 +
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/sparc/include/asm/cpudata_64.h b/arch/sparc/include/asm/cpudata_64.h
index 926397d..050ef35 100644
--- a/arch/sparc/include/asm/cpudata_64.h
+++ b/arch/sparc/include/asm/cpudata_64.h
@@ -17,7 +17,7 @@ typedef struct {
 	unsigned int	__nmi_count;
 	unsigned long	clock_tick;	/* %tick's per second */
 	unsigned long	__pad;
-	unsigned int	__pad1;
+	unsigned int	irq0_irqs;
 	unsigned int	__pad2;
 
 	/* Dcache line 2, rarely used */
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c
index b287b62..75a3d1a 100644
--- a/arch/sparc/kernel/nmi.c
+++ b/arch/sparc/kernel/nmi.c
@@ -92,7 +92,6 @@ static void die_nmi(const char *str, struct pt_regs *regs, int do_panic)
 notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
 {
 	unsigned int sum, touched = 0;
-	int cpu = smp_processor_id();
 
 	clear_softint(1 << irq);
 
@@ -106,7 +105,7 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
 	else
 		pcr_ops->write(PCR_PIC_PRIV);
 
-	sum = kstat_irqs_cpu(0, cpu);
+	sum = local_cpu_data().irq0_irqs;
 	if ...
Previous thread: sparc64: Remove profiling from some low-level bits. by Linux Kernel Mailing List on Tuesday, April 13, 2010 - 12:59 pm. (1 message)

Next thread: sparc64: Add HAVE_FUNCTION_TRACE_MCOUNT_TEST and tidy up. by Linux Kernel Mailing List on Tuesday, April 13, 2010 - 12:59 pm. (1 message)