Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751347AbdIOLrP (ORCPT ); Fri, 15 Sep 2017 07:47:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55120 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751184AbdIOLrN (ORCPT ); Fri, 15 Sep 2017 07:47:13 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 55A934A6E0 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: [PATCH 3/7] kvm,lapic: Justify use of swait_activate() To: Davidlohr Bueso , mingo@kernel.org, peterz@infradead.org Cc: npiggin@gmail.com, paulmck@linux.vnet.ibm.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso References: <20170913200824.28067-1-dave@stgolabs.net> <20170913200824.28067-4-dave@stgolabs.net> From: Paolo Bonzini Message-ID: Date: Fri, 15 Sep 2017 13:47:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170913200824.28067-4-dave@stgolabs.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 15 Sep 2017 11:47:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 762 Lines: 28 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