From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rik van Riel Subject: Re: [patch 2/2] KVM: x86: add option to advance tscdeadline hrtimer expiration Date: Wed, 10 Dec 2014 12:11:57 -0500 Message-ID: <54887EDD.8010708@redhat.com> References: <20141210170601.674935761@redhat.com> <20141210170617.868978945@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Luiz Capitulino , Paolo Bonzini , Radim Krcmar To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43321 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932332AbaLJRUA (ORCPT ); Wed, 10 Dec 2014 12:20:00 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBAHJeLN004377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 10 Dec 2014 12:20:00 -0500 In-Reply-To: <20141210170617.868978945@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/10/2014 12:06 PM, Marcelo Tosatti wrote: > For the hrtimer which emulates the tscdeadline timer in the guest, > add an option to advance expiration, and busy spin on VM-entry waiting > for the actual expiration time to elapse. > > This allows achieving low latencies in cyclictest (or any scenario > which requires strict timing regarding timer expiration). > > Reduces cyclictest avg latency by 50%. > > Note: this option requires tuning to find the appropriate value > for a particular hardware/guest combination. One method is to measure the > average delay between apic_timer_fn and VM-entry. > Another method is to start with 1000ns, and increase the value > in say 500ns increments until avg cyclictest numbers stop decreasing. It would be good to document how this is used, in the changelog.