From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932585AbcESPmV (ORCPT ); Thu, 19 May 2016 11:42:21 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:35834 "EHLO e06smtp16.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932358AbcESPmT (ORCPT ); Thu, 19 May 2016 11:42:19 -0400 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: borntraeger@de.ibm.com X-IBM-RcptTo: kvm@vger.kernel.org;linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon To: Paolo Bonzini , Wanpeng Li , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <1463664426-2991-1-git-send-email-wanpeng.li@hotmail.com> <19abf5c8-7016-45af-f0e6-3bdd161ffb38@redhat.com> <573DD312.4060001@de.ibm.com> <573DD5C9.2000108@de.ibm.com> <83e82f6b-bc6b-a85b-e2c7-9a1b4d4997d1@redhat.com> Cc: Wanpeng Li , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , David Matlack From: Christian Borntraeger Message-ID: <573DDED3.4090503@de.ibm.com> Date: Thu, 19 May 2016 17:42:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <83e82f6b-bc6b-a85b-e2c7-9a1b4d4997d1@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16051915-0025-0000-0000-0000186A29E1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/19/2016 05:06 PM, Paolo Bonzini wrote: > > > On 19/05/2016 17:03, Christian Borntraeger wrote: >>>> Would this work too and be simpler? >>>> Hmm, your patch does only fiddle with the grow/shrink logic (which might >>>> be a good idea independently of this change), but the original patch >>>> actually takes into account that we have a guaranteed maximum time by a >>>> wakeup timer - IOW we know exactly what the maximum poll time is. >>> >>> Yes, it's different. The question is whether a 10us poll (40,000 clock >>> cycles) has an impact even if it's sometimes wrong. >> >> Valid question. As I said, this change might be something good independent from >> the original patch. (it might make it unnecessary, though) On the other hand >> I can handle ~30 guest entry/exit cycles of a simple exit like diag9c. >> Needs measurement. > > Actually I'm okay with the original patch, and especially on s390 where > the maximum poll time is small it may make a bigger difference. Though > I suppose the timer interrupt is not floating? Right its cpu local. So a timer wakeup would be considered valid (if the timer kicks in before the poll ends - the poll does also check if the timer expires and maybe the hrtimer is a bit late. > > Since it's not 4.7 material, I'll wait for your experiments and David's > remarks. I will try to get both patches scheduled but it might take a while.