From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH/RFC] KVM: halt_polling: provide a way to qualify wakeups during poll Date: Mon, 2 May 2016 13:50:53 +0200 Message-ID: <57273F1D.1080900@de.ibm.com> References: <1462185753-14634-1-git-send-email-borntraeger@de.ibm.com> <20160502134627.71319e1b.cornelia.huck@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , KVM , linux-s390 , Jens Freimann , David Hildenbrand To: Cornelia Huck Return-path: Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:46681 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753544AbcEBLvA (ORCPT ); Mon, 2 May 2016 07:51:00 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 2 May 2016 12:50:58 +0100 In-Reply-To: <20160502134627.71319e1b.cornelia.huck@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/02/2016 01:46 PM, Cornelia Huck wrote: > On Mon, 2 May 2016 12:42:33 +0200 > Christian Borntraeger wrote: > > >> @@ -2038,14 +2039,16 @@ out: >> if (block_ns <= vcpu->halt_poll_ns) >> ; >> /* we had a long block, shrink polling */ >> - else if (vcpu->halt_poll_ns && block_ns > halt_poll_ns) >> + else if (!vcpu_valid_wakeup(vcpu) || >> + (vcpu->halt_poll_ns && block_ns > halt_poll_ns)) >> shrink_halt_poll_ns(vcpu); >> /* we had a short halt and our poll time is too small */ >> else if (vcpu->halt_poll_ns < halt_poll_ns && >> - block_ns < halt_poll_ns) >> + block_ns < halt_poll_ns && vcpu_valid_wakeup(vcpu)) > > Isn't that vcpu_valid_wakeup() check superflous, as we have collected > all !vcpu_valid_wakeup() cases in the previous if? Yes, will fix in v2. > >> grow_halt_poll_ns(vcpu); >> } else >> vcpu->halt_poll_ns = 0; >> + vcpu_reset_wakeup(vcpu); >> >> trace_kvm_vcpu_wakeup(block_ns, waited); >> } >