提交 6c142801 编写于 作者: A Avi Kivity

KVM: Fix unbounded preemption latency

When preparing to enter the guest, if an interrupt comes in while
preemption is disabled but interrupts are still enabled, we miss a
preemption point.  Fix by explicitly checking whether we need to
reschedule.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 97db56ce
......@@ -2535,6 +2535,13 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
local_irq_disable();
if (need_resched()) {
local_irq_enable();
preempt_enable();
r = 1;
goto out;
}
if (signal_pending(current)) {
local_irq_enable();
preempt_enable();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册