qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu-kvm faster that qemu?
@ 2010-08-25 19:37 walt
  2010-08-25 19:48 ` Anthony Liguori
  0 siblings, 1 reply; 14+ messages in thread
From: walt @ 2010-08-25 19:37 UTC (permalink / raw)
  To: qemu-devel

Hi qemu team,

I just discovered that qemu now offers kvm support, so I decided to
compare it to qemu-kvm.

I'm running the latest git versions of both programs on an AMD64
host running the latest kernel from Linus.git.

The guest is Windows 7 on a qcow2 disk image and one kvm64 cpu.

Using the same qcow2 image for both qemu and qemu-kvm, I find that
qemu-kvm boots to the Win7 login prompt in 25 seconds, but qemu
with kvm enabled takes about 45 seconds.

Is this an expected outcome, or must I be doing something wrong
with qemu?

BTW, I tried reverting the qcow2 patch being discussed in another
thread but it made no difference.  Perhaps there's not much writing
to disk during bootup?

Thanks!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] qemu-kvm faster that qemu?
  2010-08-25 19:37 [Qemu-devel] qemu-kvm faster that qemu? walt
@ 2010-08-25 19:48 ` Anthony Liguori
  2010-08-25 23:09   ` [Qemu-devel] Re: qemu-kvm faster than qemu? walt
  0 siblings, 1 reply; 14+ messages in thread
From: Anthony Liguori @ 2010-08-25 19:48 UTC (permalink / raw)
  To: walt; +Cc: qemu-devel

On 08/25/2010 02:37 PM, walt wrote:
> Hi qemu team,
>
> I just discovered that qemu now offers kvm support, so I decided to
> compare it to qemu-kvm.
>
> I'm running the latest git versions of both programs on an AMD64
> host running the latest kernel from Linus.git.
>
> The guest is Windows 7 on a qcow2 disk image and one kvm64 cpu.
>
> Using the same qcow2 image for both qemu and qemu-kvm, I find that
> qemu-kvm boots to the Win7 login prompt in 25 seconds, but qemu
> with kvm enabled takes about 45 seconds.


make sure you build qemu with --enable-io-thread.  Also, what's your 
full command line?

Regards,

Anthony Liguori

>
> Is this an expected outcome, or must I be doing something wrong
> with qemu?
>
> BTW, I tried reverting the qcow2 patch being discussed in another
> thread but it made no difference.  Perhaps there's not much writing
> to disk during bootup?
>
> Thanks!
>
>
>
>
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-25 19:48 ` Anthony Liguori
@ 2010-08-25 23:09   ` walt
  2010-08-25 23:28     ` Anthony Liguori
  0 siblings, 1 reply; 14+ messages in thread
From: walt @ 2010-08-25 23:09 UTC (permalink / raw)
  To: qemu-devel

On 08/25/2010 12:48 PM, Anthony Liguori wrote:
> On 08/25/2010 02:37 PM, walt wrote:
>> Hi qemu team,
>>
>> I just discovered that qemu now offers kvm support, so I decided to
>> compare it to qemu-kvm.
>>
>> I'm running the latest git versions of both programs on an AMD64
>> host running the latest kernel from Linus.git.
>>
>> The guest is Windows 7 on a qcow2 disk image and one kvm64 cpu.
>>
>> I find that qemu-kvm boots to the Win7 login prompt in 25 seconds,
 >> while qemu with kvm enabled takes about 45 seconds.
>
>
> make sure you build qemu with --enable-io-thread.

I built qemu both with and without io-thread, and it makes no difference
at least in this particular experiment.

(BTW, I found that qemu-kvm will not even compile with --enable-io-thread
because qemu_mutex_lock_iothread becomes defined in two places.)

> Also, what's your full command line?

For qemu:
/usr/local/bin/qemu-system-x86_64 -m 1024 -enable-kvm -cpu kvm64 w7.diff

For qemu-kvm:
/home/wa1ter/bin/qemu-system-x86_64 -m 1024 -enable-kvm -cpu kvm64 w7.diff

Note that w7.diff is the same file in both cases: a qcow2 differencing disk
made from the original qcow2 backing file w7.img.

Thanks for your reply.  I'm curious if anyone can reproduce this difference
in speed.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-25 23:09   ` [Qemu-devel] Re: qemu-kvm faster than qemu? walt
@ 2010-08-25 23:28     ` Anthony Liguori
  2010-08-26  7:53       ` Gerd Hoffmann
  2010-08-26 21:57       ` walt
  0 siblings, 2 replies; 14+ messages in thread
From: Anthony Liguori @ 2010-08-25 23:28 UTC (permalink / raw)
  To: walt; +Cc: qemu-devel

On 08/25/2010 06:09 PM, walt wrote:
> On 08/25/2010 12:48 PM, Anthony Liguori wrote:
>> On 08/25/2010 02:37 PM, walt wrote:
>>> Hi qemu team,
>>>
>>> I just discovered that qemu now offers kvm support, so I decided to
>>> compare it to qemu-kvm.
>>>
>>> I'm running the latest git versions of both programs on an AMD64
>>> host running the latest kernel from Linus.git.
>>>
>>> The guest is Windows 7 on a qcow2 disk image and one kvm64 cpu.
>>>
>>> I find that qemu-kvm boots to the Win7 login prompt in 25 seconds,
> >> while qemu with kvm enabled takes about 45 seconds.
>>
>>
>> make sure you build qemu with --enable-io-thread.
>
> I built qemu both with and without io-thread, and it makes no difference
> at least in this particular experiment.
>
> (BTW, I found that qemu-kvm will not even compile with --enable-io-thread
> because qemu_mutex_lock_iothread becomes defined in two places.)
>
>> Also, what's your full command line?
>
> For qemu:
> /usr/local/bin/qemu-system-x86_64 -m 1024 -enable-kvm -cpu kvm64 w7.diff
>
> For qemu-kvm:
> /home/wa1ter/bin/qemu-system-x86_64 -m 1024 -enable-kvm -cpu kvm64 
> w7.diff

You'll get more accurate and repeatable results by using:

qemu-system-x86_64 -m 1024 -enable-kvm -cpu kvm64 -drive 
file=w7.diff,cache=none

Also try qemu-kvm with -no-kvm-irqchip.  I can't believe an in-kernel 
lapic would make this much of a difference with windows 7 but it's worth 
trying.

Regards,

Anthony Liguori

>
> Note that w7.diff is the same file in both cases: a qcow2 differencing 
> disk
> made from the original qcow2 backing file w7.img.
>
> Thanks for your reply.  I'm curious if anyone can reproduce this 
> difference
> in speed.
>
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-25 23:28     ` Anthony Liguori
@ 2010-08-26  7:53       ` Gerd Hoffmann
  2010-08-26  7:59         ` Gleb Natapov
  2010-08-26 21:57       ` walt
  1 sibling, 1 reply; 14+ messages in thread
From: Gerd Hoffmann @ 2010-08-26  7:53 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: walt, qemu-devel

   Hi,

> Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel
> lapic would make this much of a difference with windows 7 but it's worth
> trying.

Didn't try win7, but for winxp it is a *huge* difference.

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-26  7:53       ` Gerd Hoffmann
@ 2010-08-26  7:59         ` Gleb Natapov
  2010-08-26  9:59           ` Gerd Hoffmann
  2010-08-26 12:54           ` Anthony Liguori
  0 siblings, 2 replies; 14+ messages in thread
From: Gleb Natapov @ 2010-08-26  7:59 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: walt, qemu-devel

On Thu, Aug 26, 2010 at 09:53:27AM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> >Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel
> >lapic would make this much of a difference with windows 7 but it's worth
> >trying.
> 
> Didn't try win7, but for winxp it is a *huge* difference.
> 
On which HW? My guess is this is because of tpr patching.

--
			Gleb.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-26  7:59         ` Gleb Natapov
@ 2010-08-26  9:59           ` Gerd Hoffmann
  2010-08-26 10:24             ` Alexander Graf
  2010-08-26 12:54           ` Anthony Liguori
  1 sibling, 1 reply; 14+ messages in thread
From: Gerd Hoffmann @ 2010-08-26  9:59 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: walt, qemu-devel

On 08/26/10 09:59, Gleb Natapov wrote:
> On Thu, Aug 26, 2010 at 09:53:27AM +0200, Gerd Hoffmann wrote:
>>    Hi,
>>
>>> Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel
>>> lapic would make this much of a difference with windows 7 but it's worth
>>> trying.
>>
>> Didn't try win7, but for winxp it is a *huge* difference.
>>
> On which HW?

Intel without ept.  It's a Lenovo T500.

> My guess is this is because of tpr patching.

Most like, yes.

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-26  9:59           ` Gerd Hoffmann
@ 2010-08-26 10:24             ` Alexander Graf
  2010-08-26 10:25               ` Gleb Natapov
  0 siblings, 1 reply; 14+ messages in thread
From: Alexander Graf @ 2010-08-26 10:24 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: walt, qemu-devel, Gleb Natapov


On 26.08.2010, at 11:59, Gerd Hoffmann wrote:

> On 08/26/10 09:59, Gleb Natapov wrote:
>> On Thu, Aug 26, 2010 at 09:53:27AM +0200, Gerd Hoffmann wrote:
>>>   Hi,
>>> 
>>>> Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel
>>>> lapic would make this much of a difference with windows 7 but it's worth
>>>> trying.
>>> 
>>> Didn't try win7, but for winxp it is a *huge* difference.
>>> 
>> On which HW?
> 
> Intel without ept.  It's a Lenovo T500.
> 
>> My guess is this is because of tpr patching.
> 
> Most like, yes.

Isn't that only required on SVM?


Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-26 10:24             ` Alexander Graf
@ 2010-08-26 10:25               ` Gleb Natapov
  2010-08-26 11:56                 ` Avi Kivity
  0 siblings, 1 reply; 14+ messages in thread
From: Gleb Natapov @ 2010-08-26 10:25 UTC (permalink / raw)
  To: Alexander Graf; +Cc: walt, Gerd Hoffmann, qemu-devel

On Thu, Aug 26, 2010 at 12:24:11PM +0200, Alexander Graf wrote:
> 
> On 26.08.2010, at 11:59, Gerd Hoffmann wrote:
> 
> > On 08/26/10 09:59, Gleb Natapov wrote:
> >> On Thu, Aug 26, 2010 at 09:53:27AM +0200, Gerd Hoffmann wrote:
> >>>   Hi,
> >>> 
> >>>> Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel
> >>>> lapic would make this much of a difference with windows 7 but it's worth
> >>>> trying.
> >>> 
> >>> Didn't try win7, but for winxp it is a *huge* difference.
> >>> 
> >> On which HW?
> > 
> > Intel without ept.  It's a Lenovo T500.
> > 
> >> My guess is this is because of tpr patching.
> > 
> > Most like, yes.
> 
> Isn't that only required on SVM?
> 
No, old vmx too.

--
			Gleb.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-26 10:25               ` Gleb Natapov
@ 2010-08-26 11:56                 ` Avi Kivity
  0 siblings, 0 replies; 14+ messages in thread
From: Avi Kivity @ 2010-08-26 11:56 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: qemu-devel, walt, Alexander Graf, Gerd Hoffmann

  On 08/26/2010 01:25 PM, Gleb Natapov wrote:
>
>> Isn't that only required on SVM?
>>
> No, old vmx too.
>

'flexpriority' in /proc/cpuinfo means tpr patching is unnecessary.

But to use flexpriority you need in-kernel irqchip, so qemu.git will be 
slow even if you have it.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-26  7:59         ` Gleb Natapov
  2010-08-26  9:59           ` Gerd Hoffmann
@ 2010-08-26 12:54           ` Anthony Liguori
  2010-08-26 12:57             ` Gleb Natapov
  1 sibling, 1 reply; 14+ messages in thread
From: Anthony Liguori @ 2010-08-26 12:54 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: walt, Gerd Hoffmann, qemu-devel

On 08/26/2010 02:59 AM, Gleb Natapov wrote:
> On Thu, Aug 26, 2010 at 09:53:27AM +0200, Gerd Hoffmann wrote:
>    
>>    Hi,
>>
>>      
>>> Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel
>>> lapic would make this much of a difference with windows 7 but it's worth
>>> trying.
>>>        
>> Didn't try win7, but for winxp it is a *huge* difference.
>>
>>      
> On which HW? My guess is this is because of tpr patching.
>    

Does Windows 7 hit the TPR heavily?  I thought all modern versions of 
Windows significantly reduced their interactions with the TPR.

Regards,

Anthony Liguori

> --
> 			Gleb.
>    

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-26 12:54           ` Anthony Liguori
@ 2010-08-26 12:57             ` Gleb Natapov
  0 siblings, 0 replies; 14+ messages in thread
From: Gleb Natapov @ 2010-08-26 12:57 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: walt, Gerd Hoffmann, qemu-devel

On Thu, Aug 26, 2010 at 07:54:26AM -0500, Anthony Liguori wrote:
> On 08/26/2010 02:59 AM, Gleb Natapov wrote:
> >On Thu, Aug 26, 2010 at 09:53:27AM +0200, Gerd Hoffmann wrote:
> >>   Hi,
> >>
> >>>Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel
> >>>lapic would make this much of a difference with windows 7 but it's worth
> >>>trying.
> >>Didn't try win7, but for winxp it is a *huge* difference.
> >>
> >On which HW? My guess is this is because of tpr patching.
> 
> Does Windows 7 hit the TPR heavily?  I thought all modern versions
> of Windows significantly reduced their interactions with the TPR.
> 
Windows 7 doesn't. tpr patching explains only winxp slowdown.
--
			Gleb.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-25 23:28     ` Anthony Liguori
  2010-08-26  7:53       ` Gerd Hoffmann
@ 2010-08-26 21:57       ` walt
  2010-08-29 15:02         ` Avi Kivity
  1 sibling, 1 reply; 14+ messages in thread
From: walt @ 2010-08-26 21:57 UTC (permalink / raw)
  To: qemu-devel

On 08/25/2010 04:28 PM, Anthony Liguori wrote:
> On 08/25/2010 06:09 PM, walt wrote:
>> On 08/25/2010 12:48 PM, Anthony Liguori wrote:
>>> On 08/25/2010 02:37 PM, walt wrote:

>>>> I find that qemu-kvm boots to the Win7 login prompt in 25 seconds,
>>>> while qemu with kvm enabled takes about 45 seconds.

>>> Also, what's your full command line?

>> /usr/local/bin/qemu-system-x86_64 -m 1024 -enable-kvm -cpu kvm64 w7.diff

> You'll get more accurate and repeatable results by using:
>
> qemu-system-x86_64 -m 1024 -enable-kvm -cpu kvm64 -drive file=w7.diff,cache=none

Turning off the cache slows both of them down, as I would expect:

qemu-kvm:  52 seconds
qemu:      65 seconds

> Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel lapic would make this much of a difference with windows 7 but it's worth trying.

Using that flag wipes out the difference entirely:  both come in at about 65 seconds.

I also tried xp-32 running on the same two kvm64 virtual machines, with slightly
different results:

qemu-kvm:  35 seconds (65 seconds using -no-kvm-irqchip, a huge disadvantage)
qemu:      58 seconds

Anything unexpected in these results?

Thanks for your time.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Re: qemu-kvm faster than qemu?
  2010-08-26 21:57       ` walt
@ 2010-08-29 15:02         ` Avi Kivity
  0 siblings, 0 replies; 14+ messages in thread
From: Avi Kivity @ 2010-08-29 15:02 UTC (permalink / raw)
  To: walt; +Cc: qemu-devel

  On 08/27/2010 12:57 AM, walt wrote:
>
>> Also try qemu-kvm with -no-kvm-irqchip. I can't believe an in-kernel 
>> lapic would make this much of a difference with windows 7 but it's 
>> worth trying.
>
> Using that flag wipes out the difference entirely:  both come in at 
> about 65 seconds.
>
> I also tried xp-32 running on the same two kvm64 virtual machines, 
> with slightly
> different results:
>
> qemu-kvm:  35 seconds (65 seconds using -no-kvm-irqchip, a huge 
> disadvantage)
> qemu:      58 seconds
>
> Anything unexpected in these results?

Looks like kernel irqchip is the cause for the difference, which isn't 
too surprising.


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-08-29 17:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-25 19:37 [Qemu-devel] qemu-kvm faster that qemu? walt
2010-08-25 19:48 ` Anthony Liguori
2010-08-25 23:09   ` [Qemu-devel] Re: qemu-kvm faster than qemu? walt
2010-08-25 23:28     ` Anthony Liguori
2010-08-26  7:53       ` Gerd Hoffmann
2010-08-26  7:59         ` Gleb Natapov
2010-08-26  9:59           ` Gerd Hoffmann
2010-08-26 10:24             ` Alexander Graf
2010-08-26 10:25               ` Gleb Natapov
2010-08-26 11:56                 ` Avi Kivity
2010-08-26 12:54           ` Anthony Liguori
2010-08-26 12:57             ` Gleb Natapov
2010-08-26 21:57       ` walt
2010-08-29 15:02         ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).