Skip to content

Commit

Permalink
KVM: LAPIC: Don't need to wakeup vCPU twice afer timer fire
Browse files Browse the repository at this point in the history
kvm_set_pending_timer() will take care to wake up the sleeping vCPU which
has pending timer, don't need to check this in apic_timer_expired() again.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Wanpeng Li authored and Paolo Bonzini committed Aug 5, 2019
1 parent 266e85a commit a48d06f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions arch/x86/kvm/lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,6 @@ static void kvm_apic_inject_pending_timer_irqs(struct kvm_lapic *apic)
static void apic_timer_expired(struct kvm_lapic *apic)
{
struct kvm_vcpu *vcpu = apic->vcpu;
struct swait_queue_head *q = &vcpu->wq;
struct kvm_timer *ktimer = &apic->lapic_timer;

if (atomic_read(&apic->lapic_timer.pending))
Expand All @@ -1566,13 +1565,6 @@ static void apic_timer_expired(struct kvm_lapic *apic)

atomic_inc(&apic->lapic_timer.pending);
kvm_set_pending_timer(vcpu);

/*
* For x86, the atomic_inc() is serialized, thus
* using swait_active() is safe.
*/
if (swait_active(q))
swake_up_one(q);
}

static void start_sw_tscdeadline(struct kvm_lapic *apic)
Expand Down

0 comments on commit a48d06f

Please sign in to comment.