preempt_enable()
之前nmi_exit()
,这是一个好的代码吗?
if ((m.cs & 3) == 3) {
/* If this triggers there is no way to recover. Die hard. */
BUG_ON(!on_thread_stack() || !user_mode(regs));
local_irq_enable();
preempt_enable();
current->task_struct_rh->mce_ripv = !!(m.mcgstatus & MCG_STATUS_RIPV);
current->task_struct_rh->mce_whole_page = whole_page(&m);
if (kill_it || do_memory_failure(&m))
force_sig(SIGBUS, current);
preempt_disable();
local_irq_disable();
} else {
if (!fixup_exception(regs, X86_TRAP_MC))
mce_panic("Failed kernel mode recovery", &m, NULL);
}
out_ist:
nmi_exit();
}
根据我的理解,如果 ,内核无法抢占preempt_count > 0
,在这种情况下,它位于 NMI 内部,因此preempt_count > 0
。
它正在发送 SIGBUS:
force_sig(SIGBUS, current);
似乎没有必要做local_irq_enable
和preempt_enable
?