From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH v4 11/11] KVM: arm/arm64: timer: remove request-less vcpu kick Date: Thu, 1 Jun 2017 15:23:55 +0200 Message-ID: <20170601132355.GK20919@cbox> References: <20170516022035.7674-1-drjones@redhat.com> <20170516022035.7674-12-drjones@redhat.com> <20170601103454.GA20919@cbox> <20170601110900.bwxffuh2nyp3jsx2@kamzik.brq.redhat.com> <076a66da-7d55-bcdb-8466-ce2abed7fcf8@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Jones , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, marc.zyngier@arm.com, rkrcmar@redhat.com To: Paolo Bonzini Return-path: Received: from mail-wm0-f46.google.com ([74.125.82.46]:38850 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751058AbdFANYL (ORCPT ); Thu, 1 Jun 2017 09:24:11 -0400 Received: by mail-wm0-f46.google.com with SMTP id n195so32233541wmg.1 for ; Thu, 01 Jun 2017 06:24:11 -0700 (PDT) Content-Disposition: inline In-Reply-To: <076a66da-7d55-bcdb-8466-ce2abed7fcf8@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jun 01, 2017 at 02:37:52PM +0200, Paolo Bonzini wrote: > > > On 01/06/2017 13:09, Andrew Jones wrote: > >>> - kvm_vcpu_kick(vcpu); > >>> + swake_up(kvm_arch_vcpu_wq(vcpu)); > >> We have kvm_vcpu_wake_up(). Why not use that? > > The are two differences between swake_up(kvm_arch_vcpu_wq(vcpu)) and > > kvm_vcpu_wake_up(vcpu) > > 1. kvm_vcpu_wake_up() has a return value: true on wake up, else false > > 2. kvm_vcpu_wake_up() increments the halt_wakeup stat when the vcpu > > is awaken > > > > (1) doesn't really matter, but (2) might. Hmm, I think we do want to > > increment that stat in this case though, so I should change this. > > Yep. > > > Also, we have another use of swake_up(kvm_arch_vcpu_wq(vcpu)), in > > kvm_arm_resume_guest(), but there I don't think we want to increment > > the halt stat, so that one is probably OK. > > I would define a __kvm_vcpu_wake_up if you don't want the stat. > I didn't mind the other one, because it is in a function in the code right above the sleep function, which uses swait_event_interruptible directly without calling kvm_vcpu_block, so the symmetry is clear there, but not in the timer case. -Christoffer