nmi: add generic nmi tracking state
This code adds an in_nmi() macro that uses the current tasks preempt count to track when it is in NMI context. Other parts of the kernel can use this to determine if the context is in NMI context or not. This code was inspired by the -rt patch in_nmi version that was written by Peter Zijlstra, who borrowed that code from Mathieu Desnoyers. Reported-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
Showing
想要评论请 注册 或 登录