Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753938AbdIETDF (ORCPT ); Tue, 5 Sep 2017 15:03:05 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:50070 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752423AbdIETBD (ORCPT ); Tue, 5 Sep 2017 15:01:03 -0400 From: Davidlohr Bueso To: mingo@redhat.com, peterz@infradead.org, pbonzini@redhat.com Cc: npiggin@gmail.com, paulmck@linux.vnet.ibm.com, dave@stgolabs.net, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: [PATCH 3/6] kvm,lapic: Justify use of swait_activate() Date: Tue, 5 Sep 2017 12:00:19 -0700 Message-Id: <20170905190022.1474-4-dave@stgolabs.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170905190022.1474-1-dave@stgolabs.net> References: <20170905190022.1474-1-dave@stgolabs.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 707 Lines: 26 A comment might serve future readers. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/lapic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 589dcc117086..fb8be28c7093 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1326,6 +1326,12 @@ static void apic_timer_expired(struct kvm_lapic *apic) atomic_inc(&apic->lapic_timer.pending); kvm_set_pending_timer(vcpu); + /* + * The above kvm_set_pending_timer implies a wmb + * which pairs with the swaiter side. Either way, + * the atomic_inc() is also serialized so using + * swait_active() is safe. + */ if (swait_active(q)) swake_up(q); -- 2.12.0