From: Dietmar Hahn Subject: Re: How to get the cache miss ratio of Guest VM Date: Wed, 11 Jan 2012 13:40:08 +0100 Message-ID: <49133461.ZjjkJcqGmj@amur> References: <25c0a808.31600.134c867d1ed.Coremail.gbtux@126.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: George Dunlap , gavin List-Id: xen-devel@lists.xenproject.org Am Mittwoch 11 Januar 2012, 12:07:48 schrieb George Dunlap: > 2012/1/10 gavin : > > I noticed that the credit2 scheduling algorithm has one runqueue every L2 > > cache that is shared by cores in one socket. If vCPUs, which need to > > communicate more with each other, are assigned to the cores sharing the same > > L2 cache, the L2 cache miss ratio of Guest VM may be reduced. And also, the > > performance of the Guest VM will be improved. Is it right? But, how to test > > the cache miss ratio of L2 in Guest VM? Are the tools that used to test the > > cache miss ratio in non-virtualized environment can be used in Xen Guest VM? > > Looking through the code, it looks like performance counters are > passed-through to HVM guests, both on AMD and Intel. And it appears > that Fujitsu is regularly using the performance counters on Intel at > least (since Deitmar Hahn has been the one posting patches for new > performance counters). > > It appears that there is no support for access to performance counters > in PV mode, other than to use them for xenoprofile (which will not > allow you to read the counters directly). > > So it's worth trying whatever method you normally use to look at > performance counters while running in an HVM guest. Yes, only HVM guests. On Intel (for what I sent patches) only some processors are supported. You have to add the hypervisor boot variable 'vpmu' in your grub/menu.lst or whatever. If your processor is not supported you will see a message in the hypervisor boot logging (it's printed from the sorce xen/arch/x86/hvm/vpmu.c function vpmu_initialise()). Dietmar. > -George -- Company details: http://ts.fujitsu.com/imprint.html