From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: 8bf00a529967dafbbb210b377c38a15834d1e979 - performance regression? Date: Mon, 4 Nov 2013 22:11:33 +0200 Message-ID: <20131104201133.GA18497@redhat.com> References: <20131031002146.GA28569@redhat.com> <20131031074808.GN4651@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34185 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791Ab3KDUIk (ORCPT ); Mon, 4 Nov 2013 15:08:40 -0500 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 rA4K8d8Q006020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Nov 2013 15:08:40 -0500 Content-Disposition: inline In-Reply-To: <20131031074808.GN4651@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 31, 2013 at 09:48:08AM +0200, Gleb Natapov wrote: > On Thu, Oct 31, 2013 at 02:21:46AM +0200, Michael S. Tsirkin wrote: > > commit 8bf00a529967dafbbb210b377c38a15834d1e979: > > " KVM: VMX: add support for switching of PERF_GLOBAL_CTRL " was > > as far as I can tell supposed to bring about performance improvement > > on hardware that supports it? > No, it (and commits after it) supposed to fix a bug which it did. > > > Instead it seems to make the typical case (not running guest > > under perf) a bit slower than it used to be. > > the cost of VMexit goes up by about 50 cycles > > on sandy bridge where the optimization in question > > actually is activated. > > > You seams to be confused. 8bf00a529967dafbbb210 adds support for special > PERF_GLOBAL_CTRL switching, but does not add code to switch anything, > so the commit itself is a nop. It does add code to add_atomic_switch_msr. > Next commit d7cd97964ba6d70c5 > uses add_atomic_switch_msr()/clear_atomic_switch_msr() > to switch PERF_GLOBAL_CTRL, but it does not depend on > VM_(ENTRY|EXIT)_LOAD_IA32_PERF_GLOBAL_CTRL support which previous > patch added, if the support is not there the switching will use > another mechanism which is even slower. So MSR is switched no matter > if PERF_GLOBAL_CTRL is enabled or not. If you saying that using > VM_(ENTRY|EXIT)_LOAD_IA32_PERF_GLOBAL_CTRL is slower than using generic > vmentry MSR switching then I pretty much doubt it since the only purpose > of special VM_(ENTRY|EXIT)_LOAD_IA32_PERF_GLOBAL_CTRL is to be faster > then general mechanism. > > -- > Gleb. > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html