From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: KVM PMU virtualization Date: Tue, 02 Mar 2010 10:57:02 +0100 Message-ID: <1267523822.25158.28.camel@laptop> References: <4B86917C.4070102@redhat.com> <20100225173423.GB4246@8bytes.org> <1267152917.1726.82.camel@localhost> <20100226085105.GC4246@8bytes.org> <20100226091732.GI15885@elte.hu> <1267513746.1726.104.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Ingo Molnar , Joerg Roedel , Jes Sorensen , KVM General , Avi Kivity , Zachary Amsden , Gleb Natapov , ming.m.lin@intel.com To: "Zhang, Yanmin" Return-path: Received: from casper.infradead.org ([85.118.1.10]:38367 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459Ab0CBJ5F (ORCPT ); Tue, 2 Mar 2010 04:57:05 -0500 Received: from e35131.upc-e.chello.nl ([213.93.35.131] helo=dyad.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1NmOqe-00008l-NI for kvm@vger.kernel.org; Tue, 02 Mar 2010 09:57:04 +0000 In-Reply-To: <1267513746.1726.104.camel@localhost> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2010-03-02 at 15:09 +0800, Zhang, Yanmin wrote: > With vanilla host kernel, perf top data is stable and spinlock doesn't take too much cpu time. > With guest os, __ticket_spin_lock consumes 28% cpu time, and sometimes it fluctuates between 9%~28%. > > Another interesting finding is aim7. If I start aim7 on tmpfs testing in guest os with 1GB memory, > the login hangs and cpu is busy. With the new patch, I could check what happens in guest os, where > spinlock is busy and kernel is shrinking memory mostly from slab. Hehe, you've just discovered the reason for paravirt spinlocks ;-) But neat stuff, although I don't think you need PERF_SAMPLE_KVM, it should simply always report the guest sample if it came from the guest, you can extend PERF_RECORD_MISC_CPUMODE_MASK to add guest states.