public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Avi Kivity <avi@redhat.com>
Cc: vatsa@linux.vnet.ibm.com, Marcelo Tosatti <mtosatti@redhat.com>,
	Gleb Natapov <gleb@redhat.com>,
	linux-kernel@vger.kernel.org, npiggin@suse.de,
	kvm@vger.kernel.org, bharata@in.ibm.com,
	Balbir Singh <balbir@in.ibm.com>,
	Jan Beulich <JBeulich@novell.com>
Subject: Re: [PATCH RFC 3/4] Paravirtualized spinlock implementation for KVM guests
Date: Tue, 03 Aug 2010 10:47:19 -0700	[thread overview]
Message-ID: <4C585627.3020800@goop.org> (raw)
In-Reply-To: <4C57BE44.9020001@redhat.com>

  On 08/02/2010 11:59 PM, Avi Kivity wrote:
>  On 08/02/2010 06:20 PM, Jeremy Fitzhardinge wrote:
>>  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.)
>
> Hm.  The tracing code already uses a specialized lock 
> (arch_spinlock_t), perhaps we can make this lock avoid the tracing?

That's not really a specialized lock; that's just the naked 
architecture-provided spinlock implementation, without all the lockdep, 
etc, etc stuff layered on top.  All these changes are at a lower level, 
so giving tracing its own type of spinlock amounts to making the 
architectures provide two complete spinlock implementations.  We could 
make tracing use, for example, an rwlock so long as we promise not to 
put tracing in the rwlock implementation - but that's hardly elegant.

> It's really sad, btw, there's all those nice lockless ring buffers and 
> then a spinlock for ftrace_vbprintk(), instead of a per-cpu buffer.

Sad indeed.

     J


  reply	other threads:[~2010-08-03 17:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26  6:11 [PATCH RFC 0/4] Paravirt-spinlock implementation for KVM guests (Version 0) Srivatsa Vaddagiri
2010-07-26  6:13 ` [PATCH RFC 1/4] Debugfs support for reading an array of u32-type integers Srivatsa Vaddagiri
2010-07-26  6:14 ` [PATCH RFC 2/4] Add yield hypercall for KVM guests Srivatsa Vaddagiri
2010-07-26 17:19   ` Jeremy Fitzhardinge
2010-07-28 14:55     ` Srivatsa Vaddagiri
2010-08-02  8:40       ` Avi Kivity
2010-08-03  5:16         ` Srivatsa Vaddagiri
2010-08-03  5:33           ` Srivatsa Vaddagiri
2010-08-02  8:32     ` Avi Kivity
2010-08-02 14:42       ` Ryan Harper
2010-08-02 14:50         ` Avi Kivity
2010-08-02 15:08       ` Jeremy Fitzhardinge
2010-07-26  6:15 ` [PATCH RFC 3/4] Paravirtualized spinlock implementation " Srivatsa Vaddagiri
2010-08-02  8:48   ` Avi Kivity
2010-08-02 15:20     ` Jeremy Fitzhardinge
2010-08-03  6:59       ` Avi Kivity
2010-08-03 17:47         ` Jeremy Fitzhardinge [this message]
2010-08-02  8:53   ` Avi Kivity
2010-07-26  6:16 ` [PATCH RFC 4/4] Add yield hypercall support in Qemu Srivatsa Vaddagiri
2010-07-26 17:18 ` [PATCH RFC 0/4] Paravirt-spinlock implementation for KVM guests (Version 0) Jeremy Fitzhardinge
2010-07-28 14:47   ` Srivatsa Vaddagiri
2010-07-28 22:10 ` Konrad Rzeszutek Wilk
2010-07-28 22:42   ` Konrad Rzeszutek Wilk
2010-08-02  8:50 ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C585627.3020800@goop.org \
    --to=jeremy@goop.org \
    --cc=JBeulich@novell.com \
    --cc=avi@redhat.com \
    --cc=balbir@in.ibm.com \
    --cc=bharata@in.ibm.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=npiggin@suse.de \
    --cc=vatsa@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox