Commit 5ebf353a authored by Marc Zyngier's avatar Marc Zyngier

ARM: Remove custom IRQ stat accounting

Let's switch the arm code to the core accounting, which already
does everything we need.
Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent 8aa837cb
...@@ -6,29 +6,12 @@ ...@@ -6,29 +6,12 @@
#include <linux/threads.h> #include <linux/threads.h>
#include <asm/irq.h> #include <asm/irq.h>
/* number of IPIS _not_ including IPI_CPU_BACKTRACE */
#define NR_IPI 7
typedef struct { typedef struct {
unsigned int __softirq_pending; unsigned int __softirq_pending;
#ifdef CONFIG_SMP
unsigned int ipi_irqs[NR_IPI];
#endif
} ____cacheline_aligned irq_cpustat_t; } ____cacheline_aligned irq_cpustat_t;
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
#define __inc_irq_stat(cpu, member) __IRQ_STAT(cpu, member)++
#define __get_irq_stat(cpu, member) __IRQ_STAT(cpu, member)
#ifdef CONFIG_SMP
u64 smp_irq_stat_cpu(unsigned int cpu);
#else
#define smp_irq_stat_cpu(cpu) 0
#endif
#define arch_irq_stat_cpu smp_irq_stat_cpu
#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 #define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
#endif /* __ASM_HARDIRQ_H */ #endif /* __ASM_HARDIRQ_H */
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* IRQ's are in fact implemented a bit like signal handlers for the kernel. * IRQ's are in fact implemented a bit like signal handlers for the kernel.
* Naturally it's not a 1:1 relation, but there are similarities. * Naturally it's not a 1:1 relation, but there are similarities.
*/ */
#include <linux/kernel_stat.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/irq_work.h> #include <linux/irq_work.h>
#include <linux/kernel_stat.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/bugs.h> #include <asm/bugs.h>
...@@ -65,6 +66,7 @@ enum ipi_msg_type { ...@@ -65,6 +66,7 @@ enum ipi_msg_type {
IPI_CPU_STOP, IPI_CPU_STOP,
IPI_IRQ_WORK, IPI_IRQ_WORK,
IPI_COMPLETION, IPI_COMPLETION,
NR_IPI,
/* /*
* CPU_BACKTRACE is special and not included in NR_IPI * CPU_BACKTRACE is special and not included in NR_IPI
* or tracable with trace_ipi_* * or tracable with trace_ipi_*
...@@ -529,27 +531,16 @@ void show_ipi_list(struct seq_file *p, int prec) ...@@ -529,27 +531,16 @@ void show_ipi_list(struct seq_file *p, int prec)
unsigned int cpu, i; unsigned int cpu, i;
for (i = 0; i < NR_IPI; i++) { for (i = 0; i < NR_IPI; i++) {
unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
seq_printf(p, "%*s%u: ", prec - 1, "IPI", i); seq_printf(p, "%*s%u: ", prec - 1, "IPI", i);
for_each_online_cpu(cpu) for_each_online_cpu(cpu)
seq_printf(p, "%10u ", seq_printf(p, "%10u ", kstat_irqs_cpu(irq, cpu));
__get_irq_stat(cpu, ipi_irqs[i]));
seq_printf(p, " %s\n", ipi_types[i]); seq_printf(p, " %s\n", ipi_types[i]);
} }
} }
u64 smp_irq_stat_cpu(unsigned int cpu)
{
u64 sum = 0;
int i;
for (i = 0; i < NR_IPI; i++)
sum += __get_irq_stat(cpu, ipi_irqs[i]);
return sum;
}
void arch_send_call_function_ipi_mask(const struct cpumask *mask) void arch_send_call_function_ipi_mask(const struct cpumask *mask)
{ {
smp_cross_call(mask, IPI_CALL_FUNC); smp_cross_call(mask, IPI_CALL_FUNC);
...@@ -630,10 +621,8 @@ static void do_handle_IPI(int ipinr) ...@@ -630,10 +621,8 @@ static void do_handle_IPI(int ipinr)
{ {
unsigned int cpu = smp_processor_id(); unsigned int cpu = smp_processor_id();
if ((unsigned)ipinr < NR_IPI) { if ((unsigned)ipinr < NR_IPI)
trace_ipi_entry_rcuidle(ipi_types[ipinr]); trace_ipi_entry_rcuidle(ipi_types[ipinr]);
__inc_irq_stat(cpu, ipi_irqs[ipinr]);
}
switch (ipinr) { switch (ipinr) {
case IPI_WAKEUP: case IPI_WAKEUP:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment