aboutsummaryrefslogtreecommitdiffstats
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
parent5a5fb7dbe88dd57dc2bef0f3be9da991e789612d (diff)
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);
175 */ 175 */
176extern void irq_exit(void); 176extern void irq_exit(void);
177 177
178#define nmi_enter() \ 178#define nmi_enter() \
179 do { \ 179 do { \
180 ftrace_nmi_enter(); \ 180 ftrace_nmi_enter(); \
181 BUG_ON(in_nmi()); \ 181 BUG_ON(in_nmi()); \
182 add_preempt_count(NMI_OFFSET); \ 182 add_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
183 lockdep_off(); \ 183 lockdep_off(); \
184 rcu_nmi_enter(); \ 184 rcu_nmi_enter(); \
185 __irq_enter(); \ 185 trace_hardirq_enter(); \
186 } while (0) 186 } while (0)
187 187
188#define nmi_exit() \ 188#define nmi_exit() \
189 do { \ 189 do { \
190 __irq_exit(); \ 190 trace_hardirq_exit(); \
191 rcu_nmi_exit(); \ 191 rcu_nmi_exit(); \
192 lockdep_on(); \ 192 lockdep_on(); \
193 BUG_ON(!in_nmi()); \ 193 BUG_ON(!in_nmi()); \
194 sub_preempt_count(NMI_OFFSET); \ 194 sub_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
195 ftrace_nmi_exit(); \ 195 ftrace_nmi_exit(); \
196 } while (0) 196 } while (0)
197 197
198#endif /* LINUX_HARDIRQ_H */ 198#endif /* LINUX_HARDIRQ_H */