public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo@kvack.org>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: Re: [patch 1/3] QEMU/KVM: separate thread for IO handling
Date: Thu, 27 Mar 2008 12:48:59 -0300	[thread overview]
Message-ID: <20080327154859.GA8184@dmt> (raw)
In-Reply-To: <47EBBBFA.9070508@qumranet.com>

On Thu, Mar 27, 2008 at 05:23:38PM +0200, Avi Kivity wrote:
> Marcelo Tosatti wrote:
> >Move IO processing from vcpu0 to a dedicated thread.
> >
> >This removes load on vcpu0 by allowing better cache locality and also
> >improves latency.
> >
> >  
> 
> Does live migration (and stop/cont) still work with this?

Yes, live migration works with UP.

SMP migration is broken, but its not an issue related to
pausing/resuming of threads (its broken even without the change). What
happens is that all threads run successfully on the target (you can see
the guest reading the PM timer), but its locked wasting lots of CPU
cycles (KVM is emulating some instruction(s)). Will look into it later.

> 
> >We can now block signal handling for IO events, so sigtimedwait won't
> >race with handlers:
> >
> >- Currently the SIGALRM handler fails to set CPU_INTERRUPT_EXIT because
> >the "next_cpu" variable is not initialized in the KVM path, meaning that
> >processing of timer expiration might be delayed until the next vcpu0 exit.
> >  
> 
> I still don't understand this.  Timer expiration ought to be processed 
> in the iothread, when SIGALRM is dequeued, and be completely unrelated 
> to whatever vcpu 0 is doing.

Yes, now it is unrelated. But before the patch it wasnt. So "currently
the SIGALRM handler..." means the current code in kvm-userspace.git.

> >- Processing of IO events will not be unnecessarily interrupted.
> >  
> 
> What do you mean by this?

That SIGIO, SIGALRM and SIGUSR2 signals will not interrupt
main_loop_wait(), since they are now blocked. Better latency, less time
holding the mutex lock.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

  reply	other threads:[~2008-03-27 15:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27 15:09 [patch 0/3] QEMU dedicated IO thread Marcelo Tosatti
2008-03-27 15:09 ` [patch 1/3] QEMU/KVM: separate thread for IO handling Marcelo Tosatti
2008-03-27 15:23   ` Avi Kivity
2008-03-27 15:48     ` Marcelo Tosatti [this message]
2008-03-27 15:49       ` Avi Kivity
2008-03-27 15:09 ` [patch 2/3] QEMU/KVM: add function to handle signals Marcelo Tosatti
2008-03-27 15:25   ` Avi Kivity
2008-03-27 15:57     ` Marcelo Tosatti
2008-03-27 15:57       ` Avi Kivity
2008-03-27 16:55   ` Avi Kivity
2008-03-27 15:09 ` [patch 3/3] QEMU/libkvm: dont create vcpu0 thread Marcelo Tosatti
2008-03-27 15:55   ` Avi Kivity
2008-03-27 15:54 ` [patch 0/3] QEMU dedicated IO thread Avi Kivity
2008-03-27 19:06   ` Avi Kivity
2008-03-27 20:21     ` Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2008-04-02 23:20 [patch 0/3] separate thread for IO handling V3 Marcelo Tosatti
2008-04-02 23:20 ` [patch 1/3] QEMU/KVM: separate thread for IO handling Marcelo Tosatti

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=20080327154859.GA8184@dmt \
    --to=marcelo@kvack.org \
    --cc=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    /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