public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* *insane* amount of host_state_reloads for openbsd guest in 0.14
@ 2011-03-11 12:02 Michael Tokarev
  2011-03-14 10:00 ` Daniel Bareiro
  2011-03-16 19:48 ` Marcelo Tosatti
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Tokarev @ 2011-03-11 12:02 UTC (permalink / raw)
  To: KVM list

I tried Openbsd 4.8 in kvm today and immediately noticed
that it is running _very_ slow, boot takes several minutes
to complete to the "login:" prompt.  After investigating
I found that kvm does really insane amount of host_state_reloads.
Here are typical kvm_stats:

During bootup while checking/mounting filesystems etc:

 host_state_reload                         13782074  671689
 exits                                     24071297   45751
 insn_emulation                            21707073   45353
 io_exits                                   6900215     288
 mmio_exits                                   20057     226
 irq_injections                                6533     223
 pf_fixed                                      9801     176
 mmu_pte_write                                17781     111
 irq_exits                                     6490      20
 fpu_reload                                     133       1
 halt_exits                                     422       0
 mmu_cache_miss                                 333       0
 halt_wakeup                                     30       0
 mmu_shadow_zapped                              358       0
 remote_tlb_flush                                 3       0
 signal_exits                                     1       0


After booting, idle guest sitting at login: prompt:

 host_state_reload                         28675531   44171
 exits                                     25184108    3379
 insn_emulation                            22784490    3266
 irq_injections                               54139     200
 mmio_exits                                   52748     122
 mmu_pte_write                                41584     100
 halt_exits                                   22731      99
 irq_exits                                     9220      12
 io_exits                                   6912620       9
 fpu_reload                                     765       1
 pf_fixed                                     12419       0
 mmu_shadow_zapped                              358       0
 mmu_cache_miss                                 339       0
 halt_wakeup                                     38       0
 remote_tlb_flush                                 3       0
 signal_exits                                     1       0


So I played with various options for a bit and found that:

o 0.14 -no-kvm-irqchip gets rid of host_state_reloads, making
 them to be the same (+/-100) as insn_emulations, and speeds
 up guest significantly (and lowers CPU usage on host during
 guest idle time).

o 0.14 -no-kvm makes the guest *faster* than w/o any additional
 options, reducing boot time for about 50% (but increasing host
 CPU usage to maximum)

o 0.12 without any options is the fastest, and it keeps number
 of reloads to be within 3k/sec range during all time. here's
 typical kvm_stats of idle guest with 0.12:

kvm 0.12 and idle guest:

 exits                                     25975600    3329
 insn_emulation                            23555272    3229
 host_state_reload                          1898575    3117
 irq_injections                               13125     200
 mmio_exits                                   26603     122
 mmu_pte_write                                61515     100
 halt_exits                                    5173     100
 irq_exits                                     6927       1
 fpu_reload                                     499       1
 io_exits                                   7058999       1
 pf_fixed                                     11902       0
 mmu_shadow_zapped                              634       0
 mmu_cache_miss                                 558       0
 halt_wakeup                                    166       0
 remote_tlb_flush                                 2       0
 signal_exits                                     1       0


Again, running on the same AthlonII machine with 2.6.37 host
kernel, freshly installed openbsd 4.3 32bit guest (with all
defaults).

FreeBSD does not show this behavour.

What it can be?

Thanks!

/mjt

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

* Re: *insane* amount of host_state_reloads for openbsd guest in 0.14
  2011-03-11 12:02 *insane* amount of host_state_reloads for openbsd guest in 0.14 Michael Tokarev
@ 2011-03-14 10:00 ` Daniel Bareiro
  2011-03-16 19:48 ` Marcelo Tosatti
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Bareiro @ 2011-03-14 10:00 UTC (permalink / raw)
  To: KVM list

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

Hi, Michael.

On Friday, 11 March 2011 15:02:33 +0300,
Michael Tokarev wrote:

> I tried Openbsd 4.8 in kvm today and immediately noticed
> that it is running _very_ slow, boot takes several minutes
> to complete to the "login:" prompt.  After investigating
> I found that kvm does really insane amount of host_state_reloads.
> Here are typical kvm_stats:
>
> [...]

Some time ago I commented [1] on the list a substance difference observed in
the network transfer rate in a virtual machine with OpenBSD 4.8
regarding virtual machines with Debian GNU/Linux. Could this be related
to the same problem you mentioned?


Regards,
Daniel

[1] http://thread.gmane.org/gmane.comp.emulators.kvm.devel/65876
-- 
Fingerprint: BFB3 08D6 B4D1 31B2 72B9  29CE 6696 BF1B 14E6 1D37
Powered by Debian GNU/Linux Lenny - Linux user #188.598

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: *insane* amount of host_state_reloads for openbsd guest in 0.14
  2011-03-11 12:02 *insane* amount of host_state_reloads for openbsd guest in 0.14 Michael Tokarev
  2011-03-14 10:00 ` Daniel Bareiro
@ 2011-03-16 19:48 ` Marcelo Tosatti
  2011-03-16 19:55   ` Michael Tokarev
  1 sibling, 1 reply; 5+ messages in thread
From: Marcelo Tosatti @ 2011-03-16 19:48 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: KVM list

On Fri, Mar 11, 2011 at 03:02:33PM +0300, Michael Tokarev wrote:
> I tried Openbsd 4.8 in kvm today and immediately noticed
> that it is running _very_ slow, boot takes several minutes
> to complete to the "login:" prompt.  After investigating
> I found that kvm does really insane amount of host_state_reloads.
> Here are typical kvm_stats:
> 
> During bootup while checking/mounting filesystems etc:
> 
>  host_state_reload                         13782074  671689
>  exits                                     24071297   45751
>  insn_emulation                            21707073   45353
>  io_exits                                   6900215     288
>  mmio_exits                                   20057     226
>  irq_injections                                6533     223
>  pf_fixed                                      9801     176
>  mmu_pte_write                                17781     111
>  irq_exits                                     6490      20
>  fpu_reload                                     133       1
>  halt_exits                                     422       0
>  mmu_cache_miss                                 333       0
>  halt_wakeup                                     30       0
>  mmu_shadow_zapped                              358       0
>  remote_tlb_flush                                 3       0
>  signal_exits                                     1       0
> 
> 
> After booting, idle guest sitting at login: prompt:
> 
>  host_state_reload                         28675531   44171
>  exits                                     25184108    3379
>  insn_emulation                            22784490    3266
>  irq_injections                               54139     200
>  mmio_exits                                   52748     122
>  mmu_pte_write                                41584     100
>  halt_exits                                   22731      99
>  irq_exits                                     9220      12
>  io_exits                                   6912620       9
>  fpu_reload                                     765       1
>  pf_fixed                                     12419       0
>  mmu_shadow_zapped                              358       0
>  mmu_cache_miss                                 339       0
>  halt_wakeup                                     38       0
>  remote_tlb_flush                                 3       0
>  signal_exits                                     1       0
> 
> 
> So I played with various options for a bit and found that:
> 
> o 0.14 -no-kvm-irqchip gets rid of host_state_reloads, making
>  them to be the same (+/-100) as insn_emulations, and speeds
>  up guest significantly (and lowers CPU usage on host during
>  guest idle time).
> 
> o 0.14 -no-kvm makes the guest *faster* than w/o any additional
>  options, reducing boot time for about 50% (but increasing host
>  CPU usage to maximum)
> 
> o 0.12 without any options is the fastest, and it keeps number
>  of reloads to be within 3k/sec range during all time. here's
>  typical kvm_stats of idle guest with 0.12:
> 
> kvm 0.12 and idle guest:
> 
>  exits                                     25975600    3329
>  insn_emulation                            23555272    3229
>  host_state_reload                          1898575    3117
>  irq_injections                               13125     200
>  mmio_exits                                   26603     122
>  mmu_pte_write                                61515     100
>  halt_exits                                    5173     100
>  irq_exits                                     6927       1
>  fpu_reload                                     499       1
>  io_exits                                   7058999       1
>  pf_fixed                                     11902       0
>  mmu_shadow_zapped                              634       0
>  mmu_cache_miss                                 558       0
>  halt_wakeup                                    166       0
>  remote_tlb_flush                                 2       0
>  signal_exits                                     1       0
> 
> 
> Again, running on the same AthlonII machine with 2.6.37 host
> kernel, freshly installed openbsd 4.3 32bit guest (with all
> defaults).
> 
> FreeBSD does not show this behavour.
> 
> What it can be?

Perhaps OpenBSD is accessing the HPET frequently, which is emulated 
in userspace. Try disabling it with "-no-hpet".


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

* Re: *insane* amount of host_state_reloads for openbsd guest in 0.14
  2011-03-16 19:48 ` Marcelo Tosatti
@ 2011-03-16 19:55   ` Michael Tokarev
  2011-03-17  7:24     ` Gleb Natapov
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Tokarev @ 2011-03-16 19:55 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: KVM list

16.03.2011 22:48, Marcelo Tosatti wrote:
> On Fri, Mar 11, 2011 at 03:02:33PM +0300, Michael Tokarev wrote:
>> I tried Openbsd 4.8 in kvm today and immediately noticed
>> that it is running _very_ slow, boot takes several minutes
>> to complete to the "login:" prompt.  After investigating
>> I found that kvm does really insane amount of host_state_reloads.
>> Here are typical kvm_stats:
>>
>> During bootup while checking/mounting filesystems etc:
>>
>>  host_state_reload                         13782074  671689
>>  exits                                     24071297   45751
>>  insn_emulation                            21707073   45353
>>  io_exits                                   6900215     288
[]
>> After booting, idle guest sitting at login: prompt:
>>
>>  host_state_reload                         28675531   44171
>>  exits                                     25184108    3379
>>  insn_emulation                            22784490    3266
>>  irq_injections                               54139     200
[]
>> So I played with various options for a bit and found that:
>>
>> o 0.14 -no-kvm-irqchip gets rid of host_state_reloads, making
>>  them to be the same (+/-100) as insn_emulations, and speeds
>>  up guest significantly (and lowers CPU usage on host during
>>  guest idle time).
>>
>> o 0.14 -no-kvm makes the guest *faster* than w/o any additional
>>  options, reducing boot time for about 50% (but increasing host
>>  CPU usage to maximum)
>>
>> o 0.12 without any options is the fastest, and it keeps number
>>  of reloads to be within 3k/sec range during all time. here's
>>  typical kvm_stats of idle guest with 0.12:
>>

> Perhaps OpenBSD is accessing the HPET frequently, which is emulated 
> in userspace. Try disabling it with "-no-hpet".

-no-hpet makes no visible difference, exactly the same thing as above:

 host_state_reload                         21310655   43968
 exits                                     25007599    3573
 insn_emulation                            22635201    3469

Thanks!

/mjt

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

* Re: *insane* amount of host_state_reloads for openbsd guest in 0.14
  2011-03-16 19:55   ` Michael Tokarev
@ 2011-03-17  7:24     ` Gleb Natapov
  0 siblings, 0 replies; 5+ messages in thread
From: Gleb Natapov @ 2011-03-17  7:24 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Marcelo Tosatti, KVM list

On Wed, Mar 16, 2011 at 10:55:02PM +0300, Michael Tokarev wrote:
> 16.03.2011 22:48, Marcelo Tosatti wrote:
> > On Fri, Mar 11, 2011 at 03:02:33PM +0300, Michael Tokarev wrote:
> >> I tried Openbsd 4.8 in kvm today and immediately noticed
> >> that it is running _very_ slow, boot takes several minutes
> >> to complete to the "login:" prompt.  After investigating
> >> I found that kvm does really insane amount of host_state_reloads.
> >> Here are typical kvm_stats:
> >>
> >> During bootup while checking/mounting filesystems etc:
> >>
> >>  host_state_reload                         13782074  671689
> >>  exits                                     24071297   45751
> >>  insn_emulation                            21707073   45353
> >>  io_exits                                   6900215     288
> []
> >> After booting, idle guest sitting at login: prompt:
> >>
> >>  host_state_reload                         28675531   44171
> >>  exits                                     25184108    3379
> >>  insn_emulation                            22784490    3266
> >>  irq_injections                               54139     200
> []
> >> So I played with various options for a bit and found that:
> >>
> >> o 0.14 -no-kvm-irqchip gets rid of host_state_reloads, making
> >>  them to be the same (+/-100) as insn_emulations, and speeds
> >>  up guest significantly (and lowers CPU usage on host during
> >>  guest idle time).
> >>
> >> o 0.14 -no-kvm makes the guest *faster* than w/o any additional
> >>  options, reducing boot time for about 50% (but increasing host
> >>  CPU usage to maximum)
> >>
> >> o 0.12 without any options is the fastest, and it keeps number
> >>  of reloads to be within 3k/sec range during all time. here's
> >>  typical kvm_stats of idle guest with 0.12:
> >>
> 
> > Perhaps OpenBSD is accessing the HPET frequently, which is emulated 
> > in userspace. Try disabling it with "-no-hpet".
> 
> -no-hpet makes no visible difference, exactly the same thing as above:
> 
>  host_state_reload                         21310655   43968
>  exits                                     25007599    3573
>  insn_emulation                            22635201    3469
> 
Can you do ftrace of kvm events?

--
			Gleb.

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

end of thread, other threads:[~2011-03-17  7:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-11 12:02 *insane* amount of host_state_reloads for openbsd guest in 0.14 Michael Tokarev
2011-03-14 10:00 ` Daniel Bareiro
2011-03-16 19:48 ` Marcelo Tosatti
2011-03-16 19:55   ` Michael Tokarev
2011-03-17  7:24     ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox