diff options
Diffstat (limited to 'include/linux/kernel_stat.h')
-rw-r--r-- | include/linux/kernel_stat.h | 19 |
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); | |||
46 | extern unsigned long long nr_context_switches(void); | 46 | extern 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 | ||
52 | struct irq_desc; | 50 | struct irq_desc; |
53 | 51 | ||
54 | static inline void kstat_incr_irqs_this_cpu(unsigned int irq, | 52 | static 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 | ||
61 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 59 | static 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> |
67 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | 65 | extern 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 {\ | 68 | do { \ |
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 | ||
76 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) | 75 | static 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 | ||
81 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) | 80 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) |