aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/hardirq.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-02-12 14:16:46 -0500
committerSteven Rostedt <srostedt@redhat.com>2009-02-12 14:16:46 -0500
commit2a7b8df04c11a70105c1abe67d006455d3bdc944 (patch)
treeb4b709bbed075c909b8219148a6b94e6f0c3140d /include/linux/hardirq.h
parentpreempt-count: force hardirq-count to max of 10 (diff)
downloadwireguard-linux-2a7b8df04c11a70105c1abe67d006455d3bdc944.tar.xz
wireguard-linux-2a7b8df04c11a70105c1abe67d006455d3bdc944.zip
sched: do not account for NMIs
Impact: avoid corruption in system time accounting Martin Schwidefsky told me that there was an issue with NMIs and system accounting. The problem is that the accounting code is not reentrant, and if an NMI goes off after an interrupt it can corrupt the accounting. For now, the best we can do is to treat NMIs like SMIs and they are not accounted for. This patch changes nmi_enter to not call __irq_enter and to do the preempt-count and tracing calls directly. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'include/linux/hardirq.h')
-rw-r--r--include/linux/hardirq.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 9841221f53f2..faa1cf848bcd 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -175,24 +175,24 @@ extern void irq_enter(void);
*/
extern void irq_exit(void);
-#define nmi_enter() \
- do { \
- ftrace_nmi_enter(); \
- BUG_ON(in_nmi()); \
- add_preempt_count(NMI_OFFSET); \
- lockdep_off(); \
- rcu_nmi_enter(); \
- __irq_enter(); \
+#define nmi_enter() \
+ do { \
+ ftrace_nmi_enter(); \
+ BUG_ON(in_nmi()); \
+ add_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
+ lockdep_off(); \
+ rcu_nmi_enter(); \
+ trace_hardirq_enter(); \
} while (0)
-#define nmi_exit() \
- do { \
- __irq_exit(); \
- rcu_nmi_exit(); \
- lockdep_on(); \
- BUG_ON(!in_nmi()); \
- sub_preempt_count(NMI_OFFSET); \
- ftrace_nmi_exit(); \
+#define nmi_exit() \
+ do { \
+ trace_hardirq_exit(); \
+ rcu_nmi_exit(); \
+ lockdep_on(); \
+ BUG_ON(!in_nmi()); \
+ sub_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
+ ftrace_nmi_exit(); \
} while (0)
#endif /* LINUX_HARDIRQ_H */