From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 3/7] kvm,lapic: Justify use of swait_activate() Date: Fri, 15 Sep 2017 13:47:10 +0200 Message-ID: References: <20170913200824.28067-1-dave@stgolabs.net> <20170913200824.28067-4-dave@stgolabs.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: npiggin@gmail.com, paulmck@linux.vnet.ibm.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso To: Davidlohr Bueso , mingo@kernel.org, peterz@infradead.org Return-path: In-Reply-To: <20170913200824.28067-4-dave@stgolabs.net> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 13/09/2017 22:08, Davidlohr Bueso wrote: > A comment might serve future readers. > > Signed-off-by: Davidlohr Bueso > --- > arch/x86/kvm/lapic.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c > index aaf10b6f5380..69c5612be786 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); > > Better add an smp_mb__after_atomic() for documentation purposes. Paolo