From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: *insane* amount of host_state_reloads for openbsd guest in 0.14 Date: Thu, 17 Mar 2011 09:24:28 +0200 Message-ID: <20110317072428.GK10151@redhat.com> References: <4D7A0F59.1060604@msgid.tls.msk.ru> <20110316194811.GB23920@amt.cnet> <4D811596.8050902@msgid.tls.msk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , KVM list To: Michael Tokarev Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37402 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751694Ab1CQHYe (ORCPT ); Thu, 17 Mar 2011 03:24:34 -0400 Content-Disposition: inline In-Reply-To: <4D811596.8050902@msgid.tls.msk.ru> Sender: kvm-owner@vger.kernel.org List-ID: 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.