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: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
Avi Kivity 2008-01-15 18:27:32 +02:00
Родитель 97db56ce6c
Коммит 6c14280125
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -2535,6 +2535,13 @@ again:
local_irq_disable();
if (need_resched()) {
local_irq_enable();
preempt_enable();
r = 1;
goto out;
}
if (signal_pending(current)) {
local_irq_enable();
preempt_enable();