From: Davidlohr Bueso Date: Wed, 13 Sep 2017 20:08:20 +0000 (-0700) Subject: kvm,lapic: Justify use of swait_active() X-Git-Tag: v4.14-rc1~10^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc1b46803a671047be22f7832ef4a2bb3f63dd94;p=platform%2Fkernel%2Flinux-exynos.git kvm,lapic: Justify use of swait_active() A comment might serve future readers. Signed-off-by: Davidlohr Bueso Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index aaf10b6..69c5612 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -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);