All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Jan Kiszka <jan.kiszka@web.de>, Alexander Graf <agraf@suse.de>,
	Chris Wright <chrisw@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] Re: KVM call agenda for Feb 9
Date: Tue, 09 Feb 2010 16:38:25 +0200	[thread overview]
Message-ID: <4B717361.3000307@redhat.com> (raw)
In-Reply-To: <4B716EC7.1010900@codemonkey.ws>

On 02/09/2010 04:18 PM, Anthony Liguori wrote:
> On 02/09/2010 02:52 AM, Jan Kiszka wrote:
>> Alexander Graf wrote:
>>> On 09.02.2010, at 07:56, Avi Kivity wrote:
>>>> - rcuify/fine-grain qemu locks
>>> And this should be done either way, but is probably not a short-term 
>>> goal.
>>>
>> Indeed. We won't get around this longterm as it is a scalability
>> bottleneck and a killer for RT guest load. We can't push everything into
>> the kernel. Qemu needs a smart plan how to gradually convert its CPU and
>> device model to fine-grained locking.
>
> The VCPU loops should be easy to convert to lockless operation.  It's 
> easier to do this upstream but that requires a functioning IO thread.
>
> For the table based MMIO and PIO dispatch, RCU would be a good locking 
> choice since these structures are rarely updated.  The tricky bit is 
> that the APIC has to be converted over to lockless before any other 
> device can be converted because just about every device wants to 
> inject an interrupt.

The problem is that all the internal APIs now have to be threaded.  
Looking at hpet as a simple example, we have qemu_irq_pulse() and 
qemu_mod_timer().  We also have some lock inversion since hpet calls the 
timer but the timers also call hpet.  qemu_irq_pulse() feeds the various 
interrupt controllers; not a problem for kernel irqchip but nontrivial 
for qemu's ioapic and pic.

I'm not saying we should push hpet into the kernel to save userspace 
coding effort; there should be an independent reason to do this.  But I 
don't think threading qemu is going to be anything near easy.

-- 
error compiling committee.c: too many arguments to function


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Chris Wright <chrisw@redhat.com>, Jan Kiszka <jan.kiszka@web.de>,
	Alexander Graf <agraf@suse.de>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: KVM call agenda for Feb 9
Date: Tue, 09 Feb 2010 16:38:25 +0200	[thread overview]
Message-ID: <4B717361.3000307@redhat.com> (raw)
In-Reply-To: <4B716EC7.1010900@codemonkey.ws>

On 02/09/2010 04:18 PM, Anthony Liguori wrote:
> On 02/09/2010 02:52 AM, Jan Kiszka wrote:
>> Alexander Graf wrote:
>>> On 09.02.2010, at 07:56, Avi Kivity wrote:
>>>> - rcuify/fine-grain qemu locks
>>> And this should be done either way, but is probably not a short-term 
>>> goal.
>>>
>> Indeed. We won't get around this longterm as it is a scalability
>> bottleneck and a killer for RT guest load. We can't push everything into
>> the kernel. Qemu needs a smart plan how to gradually convert its CPU and
>> device model to fine-grained locking.
>
> The VCPU loops should be easy to convert to lockless operation.  It's 
> easier to do this upstream but that requires a functioning IO thread.
>
> For the table based MMIO and PIO dispatch, RCU would be a good locking 
> choice since these structures are rarely updated.  The tricky bit is 
> that the APIC has to be converted over to lockless before any other 
> device can be converted because just about every device wants to 
> inject an interrupt.

The problem is that all the internal APIs now have to be threaded.  
Looking at hpet as a simple example, we have qemu_irq_pulse() and 
qemu_mod_timer().  We also have some lock inversion since hpet calls the 
timer but the timers also call hpet.  qemu_irq_pulse() feeds the various 
interrupt controllers; not a problem for kernel irqchip but nontrivial 
for qemu's ioapic and pic.

I'm not saying we should push hpet into the kernel to save userspace 
coding effort; there should be an independent reason to do this.  But I 
don't think threading qemu is going to be anything near easy.

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2010-02-09 14:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-09  1:28 KVM call agenda for Feb 9 Chris Wright
2010-02-09  1:28 ` [Qemu-devel] " Chris Wright
2010-02-09  6:56 ` Avi Kivity
2010-02-09  6:56   ` [Qemu-devel] " Avi Kivity
2010-02-09  7:16   ` Alexander Graf
2010-02-09  8:52     ` Jan Kiszka
2010-02-09  8:52       ` Jan Kiszka
2010-02-09 14:18       ` Anthony Liguori
2010-02-09 14:18         ` Anthony Liguori
2010-02-09 14:38         ` Avi Kivity [this message]
2010-02-09 14:38           ` Avi Kivity
2010-02-09 15:08           ` Anthony Liguori
2010-02-09 15:08             ` Anthony Liguori
2010-02-09 15:32             ` Avi Kivity
2010-02-09 15:32               ` Avi Kivity
2010-02-09 14:15   ` Anthony Liguori
2010-02-09 14:15     ` [Qemu-devel] " Anthony Liguori
2010-02-09 14:18   ` Avi Kivity
2010-02-09 14:18     ` [Qemu-devel] " 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=4B717361.3000307@redhat.com \
    --to=avi@redhat.com \
    --cc=agraf@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=chrisw@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.