aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel_stat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernel_stat.h')
-rw-r--r--include/linux/kernel_stat.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 44e83ba12b5..0cce2db580c 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -46,16 +46,14 @@ DECLARE_PER_CPU(struct kernel_stat, kstat);
46extern unsigned long long nr_context_switches(void); 46extern unsigned long long nr_context_switches(void);
47 47
48#ifndef CONFIG_GENERIC_HARDIRQS 48#ifndef CONFIG_GENERIC_HARDIRQS
49#define kstat_irqs_this_cpu(irq) \
50 (this_cpu_read(kstat.irqs[irq])
51 49
52struct irq_desc; 50struct irq_desc;
53 51
54static inline void kstat_incr_irqs_this_cpu(unsigned int irq, 52static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
55 struct irq_desc *desc) 53 struct irq_desc *desc)
56{ 54{
57 kstat_this_cpu.irqs[irq]++; 55 __this_cpu_inc(kstat.irqs[irq]);
58 kstat_this_cpu.irqs_sum++; 56 __this_cpu_inc(kstat.irqs_sum);
59} 57}
60 58
61static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) 59static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
@@ -65,17 +63,18 @@ static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
65#else 63#else
66#include <linux/irq.h> 64#include <linux/irq.h>
67extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); 65extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
68#define kstat_irqs_this_cpu(DESC) \ 66
69 ((DESC)->kstat_irqs[smp_processor_id()]) 67#define kstat_incr_irqs_this_cpu(irqno, DESC) \
70#define kstat_incr_irqs_this_cpu(irqno, DESC) do {\ 68do { \
71 ((DESC)->kstat_irqs[smp_processor_id()]++);\ 69 __this_cpu_inc(*(DESC)->kstat_irqs); \
72 kstat_this_cpu.irqs_sum++; } while (0) 70 __this_cpu_inc(kstat.irqs_sum); \
71} while (0)
73 72
74#endif 73#endif
75 74
76static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) 75static inline void kstat_incr_softirqs_this_cpu(unsigned int irq)
77{ 76{
78 kstat_this_cpu.softirqs[irq]++; 77 __this_cpu_inc(kstat.softirqs[irq]);
79} 78}
80 79
81static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) 80static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu)