From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Lieven Subject: Re: performance trouble Date: Thu, 22 Mar 2012 09:47:53 +0100 Message-ID: <4F6AE739.4000303@dlh.net> References: <20120222163356.GE26955@nfs-rbx.ovh.net> <20120223083807.GA17505@redhat.com> <20120316101331.GM12293@nfs-rbx.ovh.net> <20120319105134.GA27928@redhat.com> <20120320093220.GS12293@nfs-rbx.ovh.net> <20120320094541.GH22368@redhat.com> <20120320111839.GT12293@nfs-rbx.ovh.net> <20120320123821.GL22368@redhat.com> <20120321111001.GV12293@nfs-rbx.ovh.net> <4F6A1056.1020904@dlh.net> <20120322083155.GW12293@nfs-rbx.ovh.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Avi Kivity , kvm@vger.kernel.org, Vadim Rozenfeld To: David Cure Return-path: Received: from ssl.dlh.net ([91.198.192.8]:42890 "EHLO ssl.dlh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752629Ab2CVIrz (ORCPT ); Thu, 22 Mar 2012 04:47:55 -0400 In-Reply-To: <20120322083155.GW12293@nfs-rbx.ovh.net> Sender: kvm-owner@vger.kernel.org List-ID: On 22.03.2012 09:31, David Cure wrote: > Le Wed, Mar 21, 2012 at 06:31:02PM +0100, Peter Lieven ecrivait : >> please keep in mind, that setting -hypervisor, disabling hpet and only >> one vcpu >> makes windows use tsc as clocksource. you have to make sure, that your vm >> is not switching between physical sockets on your system and that you have >> constant_tsc feature to have a stable tsc between the cores in the >> same socket. its also likely that the vm will crash when live migrated. > ok, yet I "only" have disable hpet and use 1vcpu. you have to use 1 vcpu on 32-bit windows. 64-bit seems to work with more than 1 vcpu. why all those limitations: windows avoids using tsc in a hypervisor which is a good decision. problem is it falls back to pm_timer or hpet. both of them are very expensive in emulation currently because kvm exits kernel mode and the userspace qemu-kvm handles this. i have done experiments where i saw ~20.000 userpace exits just for pmtimer reads. this made up ~30-40% of the whole processing power. every call to a QPC timer in windows causes a pm_timer/hpet read. especially each i/o request seems to cause a QPC timer read and which is odd as well a lazy fpu call (but this is a differnt issue) which also is very expensive to emulate (currently). > for the switching I need to pin the vcpu on 1 physical proc, > right ? you need 1 vcpu for 32-bit windows and disabling hypervisor to cheat windows and make it think it runs on real hardware. it then uses tsc. > for constant_tsc, how can I check if I use it ? cat /proc/cpuinfo on the host. there should be a flag 'constant_tsc'. it might be that also rdtscp is necessary. > for live migration : what is the "feature" that cause trouble : > -hypervisor, hpet, vcpu or all ? using tsc as clocksource is the problem not the features themselves. peter > David. >