Skip to content

Commit

Permalink
kvm,lapic: Justify use of swait_active()
Browse files Browse the repository at this point in the history
A comment might serve future readers.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Davidlohr Bueso authored and Paolo Bonzini committed Sep 15, 2017
1 parent b9f67a4 commit cc1b468
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kvm/lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,10 @@ 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(q);

Expand Down

0 comments on commit cc1b468

Please sign in to comment.