ARM: SMP: move ipi_count into irq_stat structure
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 15 Nov 2010 14:20:41 +0000 (14:20 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 20 Dec 2010 15:06:58 +0000 (15:06 +0000)
Move the ipi_count into irq_stat, which allows the ipi_data structure
to be entirely removed.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/hardirq.h
arch/arm/kernel/smp.c

index 923eaa1ba83b7ceba1612e764f29b0de7899e52e..824b08aa3f7a3e6cb52b00c88d77a0f9de28ac60 100644 (file)
@@ -10,6 +10,9 @@ typedef struct {
 #ifdef CONFIG_LOCAL_TIMERS
        unsigned int local_timer_irqs;
 #endif
+#ifdef CONFIG_SMP
+       unsigned int ipi_irqs;
+#endif
 } ____cacheline_aligned irq_cpustat_t;
 
 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
index 24131264ec2c62cd9236098f72728fc561b6ea97..65b5ba8678058a81ced5ca405b8dcdfaeca8d705 100644 (file)
  */
 struct secondary_data secondary_data;
 
-/*
- * structures for inter-processor calls
- */
-struct ipi_data {
-       unsigned long ipi_count;
-};
-
-static DEFINE_PER_CPU(struct ipi_data, ipi_data);
-
 enum ipi_msg_type {
        IPI_TIMER = 2,
        IPI_RESCHEDULE,
@@ -398,7 +389,7 @@ void show_ipi_list(struct seq_file *p)
        seq_puts(p, "IPI:");
 
        for_each_present_cpu(cpu)
-               seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count);
+               seq_printf(p, " %10u", __get_irq_stat(cpu, ipi_irqs));
 
        seq_putc(p, '\n');
 }
@@ -513,10 +504,9 @@ static void ipi_cpu_stop(unsigned int cpu)
 asmlinkage void __exception do_IPI(int ipinr, struct pt_regs *regs)
 {
        unsigned int cpu = smp_processor_id();
-       struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
        struct pt_regs *old_regs = set_irq_regs(regs);
 
-       ipi->ipi_count++;
+       __inc_irq_stat(cpu, ipi_irqs);
 
        switch (ipinr) {
        case IPI_TIMER: