From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH kvm-unit-tests] pmu: fixes for Sandy Bridge hosts Date: Mon, 3 Jun 2013 09:38:54 +0300 Message-ID: <20130603063854.GU4725@redhat.com> References: <1369935788-19069-1-git-send-email-pbonzini@redhat.com> <20130602153209.GJ24773@redhat.com> <51AC38A9.5010703@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54487 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872Ab3FCGi4 (ORCPT ); Mon, 3 Jun 2013 02:38:56 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r536cuES029052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Jun 2013 02:38:56 -0400 Content-Disposition: inline In-Reply-To: <51AC38A9.5010703@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jun 03, 2013 at 08:33:13AM +0200, Paolo Bonzini wrote: > Il 02/06/2013 17:32, Gleb Natapov ha scritto: > > On Thu, May 30, 2013 at 07:43:07PM +0200, Paolo Bonzini wrote: > >> This patch includes two fixes for SB: > >> > >> * the 3rd fixed counter ("ref cpu cycles") can sometimes report > >> less than the number of iterations > >> > > Is it documented? It is strange for "architectural" counter to behave > > differently on different architectures. > > It just counts the CPU cycles. If the CPU can optimize the loop better, > it will take less CPU cycles to execute it. > We should try and change the loop so that it will not be so easily optimized. Making the test succeed if only 10% percent of cycles were spend on a loop may result in the test missing the case when counter counts something different. -- Gleb.