From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH RFC 3/4] Paravirtualized spinlock implementation for KVM guests Date: Mon, 02 Aug 2010 08:20:01 -0700 Message-ID: <4C56E221.6050800@goop.org> References: <20100726061150.GB21699@linux.vnet.ibm.com> <20100726061537.GC8402@linux.vnet.ibm.com> <4C568669.40001@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: vatsa@linux.vnet.ibm.com, Marcelo Tosatti , Gleb Natapov , linux-kernel@vger.kernel.org, npiggin@suse.de, kvm@vger.kernel.org, bharata@in.ibm.com, Balbir Singh , Jan Beulich To: Avi Kivity Return-path: In-Reply-To: <4C568669.40001@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 08/02/2010 01:48 AM, Avi Kivity wrote: > On 07/26/2010 09:15 AM, Srivatsa Vaddagiri wrote: >> Paravirtual spinlock implementation for KVM guests, based heavily on >> Xen guest's >> spinlock implementation. >> >> >> + >> +static struct spinlock_stats >> +{ >> + u64 taken; >> + u32 taken_slow; >> + >> + u64 released; >> + >> +#define HISTO_BUCKETS 30 >> + u32 histo_spin_total[HISTO_BUCKETS+1]; >> + u32 histo_spin_spinning[HISTO_BUCKETS+1]; >> + u32 histo_spin_blocked[HISTO_BUCKETS+1]; >> + >> + u64 time_total; >> + u64 time_spinning; >> + u64 time_blocked; >> +} spinlock_stats; > > Could these be replaced by tracepoints when starting to spin/stopping > spinning etc? Then userspace can reconstruct the histogram as well as > see which locks are involved and what call paths. Unfortunately not; the tracing code uses spinlocks. (TBH I haven't actually tried, but I did give the code an eyeball to this end.) J